50 Commits

Author SHA1 Message Date
Marc Di Luzio
6869470f9b Fix feature status codes - failures here should be considered a failure 2019-05-13 19:44:22 +01:00
Marc Di Luzio
934b497603 Implement multithreaded test framework (and use for ioprio)
ioprio tests will now fail due to https://github.com/FeralInteractive/gamemode/issues/140
2019-05-13 19:44:22 +01:00
Marc Di Luzio
2249a71355 Get ready for re-setting ioprio value on un-register
Implements tests for feature

	Fixes CLAMP macro
2019-05-11 12:08:29 +01:00
Marc Di Luzio
09d63ae4f5 Set up for resetting niceness value
Add tests to check this feature
	Apply config validation in config for simplicity

	Note: if anything messes with the niceness (ie. it starts non-zero, or it's not the expected value during setup, we'll bail out)
2019-05-11 12:08:29 +01:00
Christian Kellner
41b85c245d Rewrite strncpy to silence compiler warning
Instead of initializing the char array to 0 and writing N-1 bytes,
write N-1 bytes and set the last byte manually to 0. This seems
to make gcc happy.
2019-03-28 17:14:00 +01:00
Christian Kellner
d12ab6830f No old-style function definitions.
Specify void as argument type for functions that don't take args.
2019-03-28 11:40:40 +00:00
Christian Kellner
bbde1d0357 Ensure strncpy'ed strings are all null terminated
If there is no null byte among the first n bytes of the source the
resulting string will not be properly null terminated.
Ensure that all strings that are copied via strncpy are properly
terminated copy "sizeof (dest) - 1" bytes and manually terminate
the string in the cases the array was not initialized.

Example compiler warning:
  ../daemon/gamemode-tests.c: In function ‘run_cpu_governor_tests’:
  ../daemon/gamemode-tests.c:326:4: warning: ‘strncpy’ specified bound
      256 equals destination size [-Wstringop-truncation]
    strncpy(defaultgov, currentgov, CONFIG_VALUE_MAX);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2019-03-28 11:40:40 +00:00
Alex Smith
10a31f8dec Update copyright years to 2019 2019-03-14 16:59:30 +00:00
Marc Di Luzio
fec32ac53d Remove the nv_perf_level config option and figure it out programmatically
This also fixes the instances in testing where we don't have the nv overclock in use, but we do have the mode set

	Solves issues explaining the what the perf_level actually meant, and future proofs for any PR that wants to set individual perf levels
2019-03-10 15:19:34 +00:00
Marc Di Luzio
7fb1950357 Fix formatting 2019-03-10 10:32:08 +00:00
Marc Di Luzio
54d7d3f259 Allow nv_perl_level and nv_powermizer_mode to be set independently 2019-03-10 10:32:08 +00:00
Marc Di Luzio
834a18aab4 Implement nv_powermizer_mode option to allow setting the Nvidia powermizer mode 2019-03-10 10:32:08 +00:00
Marc Di Luzio
9ade4481c3 Change AMD overclocking to simply be setting the power_dpm_force_performance_level file for now
This covers the MVP for now, and simply allows pinning the power level to "high"

	Full overclocking set up is somewhat more complicated, and it'll be better to implement that at the same time as the same for Nvidia, where we're currently only really setting the top end power level
2019-03-10 10:32:08 +00:00
Marc Di Luzio
20efaaa33f Rename the core and mem stats to nv_ prefix
These will be NV only going forward, as AMD needs a different chunk of work
2019-03-10 10:32:08 +00:00
Marc Di Luzio
6a240d550e Extend the sleep for the child gamemode in tests 2019-03-08 12:32:08 +00:00
Marc Di Luzio
0efd65fc78 set the default gov not the desired gov in tests 2019-03-08 12:14:01 +00:00
Marc Di Luzio
c215626ccd Add "script_timeout" config value to control if a user wants to extend the script timeout before kill value 2019-03-07 17:51:57 +00:00
Marc Di Luzio
53d1700a68 Add the timout to the call signature of run_external_process 2019-03-07 17:51:57 +00:00
Marc Di Luzio
4578af47ba Combine the two run_external_process functions so they both have the same timeout protection 2019-03-07 17:51:57 +00:00
Marc Di Luzio
1665447350 Use run_external_process for the script execution
This protects the main process against script exection and allows more detailed error handling
2019-03-07 17:51:57 +00:00
Marc Di Luzio
9df1dd857c Try waiting for the reaper thread at the start of tests if needed 2019-03-07 17:51:57 +00:00
Alex Smith
3c28e84700 Merge pull request #105 from mdiluz/auto-detect-vendor
Detect the GPU vendor automatically
2019-03-04 08:43:58 +00:00
Marc Di Luzio
c1dfd8bbc4 Add gamemode error strings to printouts to help debug issues 2019-02-21 17:34:20 +00:00
Marc Di Luzio
218dc9dab8 Fix up formatting 2019-02-21 17:34:20 +00:00
Marc Di Luzio
70c317233f Wait for the child to finish up 2019-02-21 17:34:20 +00:00
Marc Di Luzio
3a624350d1 Add flavor to error log messages 2019-02-21 17:34:20 +00:00
Marc Di Luzio
baf295773b Implement supervisor tests 2019-02-21 17:34:20 +00:00
Marc Di Luzio
ebe525d04e Fix up testing now that we detect the vendor 2019-02-21 17:26:14 +00:00
Marc Di Luzio
0847d3b452 Remove the vendor config value in prep for it to be auto-detected 2019-02-21 17:26:14 +00:00
Marc Di Luzio
94b6a34f65 Add test for gamemoderun and the reaper thread
Using a simple test allows us to check both at once
2019-02-20 18:08:49 +00:00
Marc Di Luzio
ab5fdad3cb Give the child more time to quit 2019-02-20 17:53:13 +00:00
Marc Di Luzio
e36a172144 Add full test for GPU settings 2019-02-20 17:53:13 +00:00
Marc Di Luzio
784cb0053d Extract testing to individual functions 2019-02-20 17:53:13 +00:00
Marc Di Luzio
a9572e6896 Begin GPU test implementation 2019-02-20 17:53:13 +00:00
Marc Di Luzio
1bc4ac626a Comment about register features
Also add comment about org.freedesktop.ScreenSaver not being fully testable
2019-02-20 17:53:13 +00:00
Marc Di Luzio
7f5e59b7c4 Add pass/fail for the CPU tests 2019-02-20 17:53:13 +00:00
Marc Di Luzio
6bfedc9692 Call the configured scripts to test them 2019-02-20 17:53:13 +00:00
Marc Di Luzio
f7dce41d8a Improve test logging output 2019-02-20 17:53:13 +00:00
Marc Di Luzio
cbf7f975d3 Add basic framework to do some script tests 2019-02-20 17:53:13 +00:00
Marc Di Luzio
6ba74284b9 Add test to verify that governor setting works 2019-02-20 17:53:13 +00:00
Marc Di Luzio
7773e5d8b7 Use the logging macros for tests 2019-02-20 17:53:13 +00:00
Marc Di Luzio
97cfc3bb17 Add game_mode_run_feature_tests to start putting feature tests 2019-02-20 17:53:13 +00:00
Marc Di Luzio
cc646fe5d2 Fix bug in tests: mypath contained junk so wasn't always null terminated 2019-02-06 19:24:55 +00:00
Marc Di Luzio
3ae26596bc Fix up logging in the tests to use our macros 2019-02-06 19:11:12 +00:00
Marc Di Luzio
f09ce2a96c Add a required NULL to execl
And add a more descriptive error for issue #100
2019-02-05 21:30:14 +00:00
Marc Di Luzio
f0816230d7 Correct error message when the initial query fails 2019-01-28 16:36:08 +00:00
Marc Di Luzio
0eece55433 Improve the test output 2019-01-28 16:36:08 +00:00
Marc Di Luzio
b97182141f Properly handle quitting by request, and use that in the tests 2019-01-28 16:36:08 +00:00
Marc Di Luzio
c99e06ed9e Small refactor
Single and dual client tests split into functions
2019-01-28 16:36:08 +00:00
Marc Di Luzio
0b4e86651e Add a preliminary client test suite
This simply tests the current functionality of the gamemode_client tools by calling each function in turn and checking the values return correctly.

	Requires the gamemode service to currently be running and installed on the system.
2019-01-28 16:36:08 +00:00