diff options
| author | Naveen Saini <naveen.kumar.saini@intel.com> | 2021-02-04 11:00:14 +0800 |
|---|---|---|
| committer | Anuj Mittal <anuj.mittal@intel.com> | 2021-02-04 11:32:57 +0800 |
| commit | 0e8b3cd2c50b0b0ceb9553dcb165113593390c74 (patch) | |
| tree | c809522c30bb30105d2b3973395d1bf8db63e411 /lib/oeqa/runtime/cases | |
| parent | 1cc1dc6e88012c7ebddedcd5d5b0a21ff283e2b6 (diff) | |
| download | meta-intel-0e8b3cd2c50b0b0ceb9553dcb165113593390c74.tar.gz | |
thermald.py: fix 'thermald --no-daemon' taking forever issue
skip test if CONFIG_THERMAL_EMULATION is not set
Observed multiple issues:
(1) Randomly not picking pid of thermld daemon (not sure why)
(2) 'thermald --no-daemon --loglevle=info' taking forever
Increase sleep time to make sure pid is avaialble.
Added timeout for the command.
Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Diffstat (limited to 'lib/oeqa/runtime/cases')
| -rw-r--r-- | lib/oeqa/runtime/cases/thermald.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/oeqa/runtime/cases/thermald.py b/lib/oeqa/runtime/cases/thermald.py index b0efecd8..a0b6a92b 100644 --- a/lib/oeqa/runtime/cases/thermald.py +++ b/lib/oeqa/runtime/cases/thermald.py | |||
| @@ -19,7 +19,7 @@ class ThermaldTest(OERuntimeTestCase): | |||
| 19 | def run_thermald_emulation_to_exceed_setpoint_then_end_thermald_process(self, run_args): | 19 | def run_thermald_emulation_to_exceed_setpoint_then_end_thermald_process(self, run_args): |
| 20 | time.sleep(2) | 20 | time.sleep(2) |
| 21 | self.target.run('echo 106000 > /sys/class/thermal/thermal_zone%s/emul_temp' % run_args) | 21 | self.target.run('echo 106000 > /sys/class/thermal/thermal_zone%s/emul_temp' % run_args) |
| 22 | time.sleep(2) | 22 | time.sleep(5) |
| 23 | __, output = self.target.run('pidof thermald') | 23 | __, output = self.target.run('pidof thermald') |
| 24 | self.target.run('kill -9 %s' % output) | 24 | self.target.run('kill -9 %s' % output) |
| 25 | 25 | ||
| @@ -27,7 +27,8 @@ class ThermaldTest(OERuntimeTestCase): | |||
| 27 | # Thermald test depend on thermal emulation, where CONFIG_THERMAL_EMULATION=y was required | 27 | # Thermald test depend on thermal emulation, where CONFIG_THERMAL_EMULATION=y was required |
| 28 | # To enable thermal emulation, refer to https://github.com/intel/thermal_daemon/blob/master/test/readme_test.txt | 28 | # To enable thermal emulation, refer to https://github.com/intel/thermal_daemon/blob/master/test/readme_test.txt |
| 29 | (status, output) = self.target.run('gzip -dc /proc/config.gz | grep CONFIG_THERMAL_EMULATION=y') | 29 | (status, output) = self.target.run('gzip -dc /proc/config.gz | grep CONFIG_THERMAL_EMULATION=y') |
| 30 | self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output)) | 30 | if status: |
| 31 | self.skipTest("CONFIG_THERMAL_EMULATION is not set") | ||
| 31 | 32 | ||
| 32 | @OEHasPackage(['thermald']) | 33 | @OEHasPackage(['thermald']) |
| 33 | @OETestDepends(['thermald.ThermaldTest.test_thermald_emulation_mode']) | 34 | @OETestDepends(['thermald.ThermaldTest.test_thermald_emulation_mode']) |
| @@ -38,7 +39,8 @@ class ThermaldTest(OERuntimeTestCase): | |||
| 38 | td_thread = threading.Thread(target=self.run_thermald_emulation_to_exceed_setpoint_then_end_thermald_process, | 39 | td_thread = threading.Thread(target=self.run_thermald_emulation_to_exceed_setpoint_then_end_thermald_process, |
| 39 | args=(x86_thermal_zone_index,)) | 40 | args=(x86_thermal_zone_index,)) |
| 40 | td_thread.start() | 41 | td_thread.start() |
| 41 | status, output = self.target.run('thermald --no-daemon --loglevel=info') | 42 | td_thread.join() |
| 43 | status, output = self.target.run('timeout 3s thermald --no-daemon --loglevel=info') | ||
| 42 | regex_search = ".*thd_cdev_set_state.*106000" | 44 | regex_search = ".*thd_cdev_set_state.*106000" |
| 43 | regex_comp = re.compile(regex_search) | 45 | regex_comp = re.compile(regex_search) |
| 44 | m = regex_comp.search(output) | 46 | m = regex_comp.search(output) |
