diff --git a/tests/eas/preliminary.py b/tests/eas/preliminary.py index 2aa6d60994d98a6cba92ee4ba7829c09515a4212..fee9ae692d6cdbb79923671cdbae4d6f740db4da 100644 --- a/tests/eas/preliminary.py +++ b/tests/eas/preliminary.py @@ -181,8 +181,10 @@ class TestWorkThroughput(BasicCheckTest): class TestEnergyModelPresent(BasicCheckTest): def test_energy_model_present(self): """Test that we can see the energy model in sysctl""" - if not self.target.file_exists( - '/proc/sys/kernel/sched_domain/cpu0/domain0/group0/energy/'): + em_path = '/proc/sys/kernel/sched_domain/cpu0/domain0/group0/energy/' + sem_path = '/sys/devices/system/cpu/energy_model' + if not (self.target.file_exists(em_path) or + self.target.file_exists(sem_path)): raise AssertionError( 'No energy model visible in procfs. Possible causes: \n' '- Kernel built without (CONFIG_SCHED_DEBUG && CONFIG_SYSCTL)\n' @@ -323,3 +325,14 @@ class TestSchedDomainFlags(BasicCheckTest): finally: self.write_cpu_caps(old_caps) self._test_asym_cpucapacity(old_caps, old_caps_asym) + + def test_sched_feat(self): + """ + Check that ENERGY_AWARE is set if it is present. + """ + path = '/sys/kernel/debug/sched_features' + sf = self.target.read_value(path) + if 'ENERGY_AWARE' not in sf: + raise SkipTest('ENERGY_AWARE sched feature not present') + if 'NO_ENERGY_AWARE' in sf: + raise AssertionError('ENERGY_AWARE sched feature is not set')