mirror of
git://git.yoctoproject.org/meta-intel.git
synced 2025-07-19 21:09:03 +02:00
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>
This commit is contained in:
parent
1cc1dc6e88
commit
0e8b3cd2c5
|
@ -19,7 +19,7 @@ class ThermaldTest(OERuntimeTestCase):
|
||||||
def run_thermald_emulation_to_exceed_setpoint_then_end_thermald_process(self, run_args):
|
def run_thermald_emulation_to_exceed_setpoint_then_end_thermald_process(self, run_args):
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
self.target.run('echo 106000 > /sys/class/thermal/thermal_zone%s/emul_temp' % run_args)
|
self.target.run('echo 106000 > /sys/class/thermal/thermal_zone%s/emul_temp' % run_args)
|
||||||
time.sleep(2)
|
time.sleep(5)
|
||||||
__, output = self.target.run('pidof thermald')
|
__, output = self.target.run('pidof thermald')
|
||||||
self.target.run('kill -9 %s' % output)
|
self.target.run('kill -9 %s' % output)
|
||||||
|
|
||||||
|
@ -27,7 +27,8 @@ class ThermaldTest(OERuntimeTestCase):
|
||||||
# Thermald test depend on thermal emulation, where CONFIG_THERMAL_EMULATION=y was required
|
# Thermald test depend on thermal emulation, where CONFIG_THERMAL_EMULATION=y was required
|
||||||
# To enable thermal emulation, refer to https://github.com/intel/thermal_daemon/blob/master/test/readme_test.txt
|
# To enable thermal emulation, refer to https://github.com/intel/thermal_daemon/blob/master/test/readme_test.txt
|
||||||
(status, output) = self.target.run('gzip -dc /proc/config.gz | grep CONFIG_THERMAL_EMULATION=y')
|
(status, output) = self.target.run('gzip -dc /proc/config.gz | grep CONFIG_THERMAL_EMULATION=y')
|
||||||
self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
|
if status:
|
||||||
|
self.skipTest("CONFIG_THERMAL_EMULATION is not set")
|
||||||
|
|
||||||
@OEHasPackage(['thermald'])
|
@OEHasPackage(['thermald'])
|
||||||
@OETestDepends(['thermald.ThermaldTest.test_thermald_emulation_mode'])
|
@OETestDepends(['thermald.ThermaldTest.test_thermald_emulation_mode'])
|
||||||
|
@ -38,7 +39,8 @@ class ThermaldTest(OERuntimeTestCase):
|
||||||
td_thread = threading.Thread(target=self.run_thermald_emulation_to_exceed_setpoint_then_end_thermald_process,
|
td_thread = threading.Thread(target=self.run_thermald_emulation_to_exceed_setpoint_then_end_thermald_process,
|
||||||
args=(x86_thermal_zone_index,))
|
args=(x86_thermal_zone_index,))
|
||||||
td_thread.start()
|
td_thread.start()
|
||||||
status, output = self.target.run('thermald --no-daemon --loglevel=info')
|
td_thread.join()
|
||||||
|
status, output = self.target.run('timeout 3s thermald --no-daemon --loglevel=info')
|
||||||
regex_search = ".*thd_cdev_set_state.*106000"
|
regex_search = ".*thd_cdev_set_state.*106000"
|
||||||
regex_comp = re.compile(regex_search)
|
regex_comp = re.compile(regex_search)
|
||||||
m = regex_comp.search(output)
|
m = regex_comp.search(output)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user