|
@@ -242,6 +242,61 @@ static int run_dual_client_tests(void)
|
|
|
return status;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+static int run_gamemoderun_and_reaper_tests(struct GameModeConfig *config)
|
|
|
+{
|
|
|
+ int status = 0;
|
|
|
+
|
|
|
+ LOG_MSG(":: Gamemoderun and reaper thread tests\n");
|
|
|
+
|
|
|
+
|
|
|
+ int child = fork();
|
|
|
+ if (child == 0) {
|
|
|
+
|
|
|
+ fclose(stdout);
|
|
|
+
|
|
|
+ if (execl("/usr/bin/gamemoderun", "/usr/bin/gamemoderun", "sh", (char *)NULL) == -1) {
|
|
|
+ LOG_ERROR("failed to launch gamemoderun with execl: %s\n", strerror(errno));
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ usleep(10000);
|
|
|
+
|
|
|
+
|
|
|
+ if (verify_other_client_connected() != 0)
|
|
|
+ status = -1;
|
|
|
+
|
|
|
+
|
|
|
+ if (kill(child, SIGTERM) == -1) {
|
|
|
+ LOG_ERROR("failed to send continue signal to other client: %s\n", strerror(errno));
|
|
|
+ status = -1;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ int wstatus;
|
|
|
+ while (waitpid(child, &wstatus, WNOHANG) == 0) {
|
|
|
+ LOG_MSG("...Waiting for child to quit...\n");
|
|
|
+ usleep(100000);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ long freq = config_get_reaper_frequency(config);
|
|
|
+ LOG_MSG("...Waiting for reaper thread (reaper_frequency set to %ld seconds)...\n", freq);
|
|
|
+ sleep((unsigned int)freq);
|
|
|
+
|
|
|
+
|
|
|
+ if (verify_deactivated() != 0)
|
|
|
+ return -1;
|
|
|
+
|
|
|
+ if (status == 0)
|
|
|
+ LOG_MSG(":: Passed\n\n");
|
|
|
+
|
|
|
+ return status;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
static int run_cpu_governor_tests(struct GameModeConfig *config)
|
|
|
{
|
|
|
|
|
@@ -450,19 +505,13 @@ int run_gpu_optimisation_tests(struct GameModeConfig *config)
|
|
|
* game_mode_run_feature_tests runs a set of tests for each current feature (based on the current
|
|
|
* config) returns 0 for success, -1 for failure
|
|
|
*/
|
|
|
-static int game_mode_run_feature_tests(void)
|
|
|
+static int game_mode_run_feature_tests(struct GameModeConfig *config)
|
|
|
{
|
|
|
int status = 0;
|
|
|
LOG_MSG(":: Feature tests\n");
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- * to cope with that */
|
|
|
- GameModeConfig *config = config_create();
|
|
|
- config_init(config);
|
|
|
-
|
|
|
|
|
|
{
|
|
|
LOG_MSG("::: Verifying CPU governor setting\n");
|
|
@@ -536,6 +585,14 @@ static int game_mode_run_feature_tests(void)
|
|
|
int game_mode_run_client_tests()
|
|
|
{
|
|
|
int status = 0;
|
|
|
+
|
|
|
+ LOG_MSG(": Loading config\n");
|
|
|
+
|
|
|
+
|
|
|
+ * to cope with that */
|
|
|
+ GameModeConfig *config = config_create();
|
|
|
+ config_init(config);
|
|
|
+
|
|
|
LOG_MSG(": Running tests\n\n");
|
|
|
|
|
|
|
|
@@ -546,11 +603,15 @@ int game_mode_run_client_tests()
|
|
|
if (run_dual_client_tests() != 0)
|
|
|
status = -1;
|
|
|
|
|
|
+
|
|
|
+ if (run_gamemoderun_and_reaper_tests(config) != 0)
|
|
|
+ status = -1;
|
|
|
+
|
|
|
if (status != 0) {
|
|
|
LOG_MSG(": Client tests failed, skipping feature tests\n");
|
|
|
} else {
|
|
|
|
|
|
- status = game_mode_run_feature_tests();
|
|
|
+ status = game_mode_run_feature_tests(config);
|
|
|
}
|
|
|
|
|
|
if (status >= 0)
|