Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ 202012 platform_tests ] TestWatchdogApi::test_arm_disarm_states failure on vms20-t1-7050cx3-3.1 #8439

Closed
sujinmkang opened this issue Aug 11, 2021 · 1 comment · Fixed by #8530
Assignees

Comments

@sujinmkang
Copy link
Collaborator

Description

Lastest 202012 image has TestWatchdogApi::test_arm_disarm_states failure on vms20-t1-7050cx3-3.1

Steps to reproduce the issue:

  1. Run sonic-mgmt/tests/platform_tests/api/test_watchdog.py::TestWatchdogApi::test_arm_disarm_states on vms20-t1-7050cx3-3.1

Describe the results you received:

2021-08-10T12:04:31.9501044Z @pytest.mark.dependency()
2021-08-10T12:04:31.9503680Z def test_arm_disarm_states(self, duthosts, enum_rand_one_per_hwsku_hostname, localhost, platform_api_conn, conf):
2021-08-10T12:04:31.9506762Z ''' arm watchdog with a valid timeout value, verify it is in armed state,
2021-08-10T12:04:31.9509330Z disarm watchdog and verify it is in disarmed state
2021-08-10T12:04:31.9511906Z '''
2021-08-10T12:04:31.9514404Z watchdog_timeout = conf['valid_timeout']
2021-08-10T12:04:31.9517456Z actual_timeout = watchdog.arm(platform_api_conn, watchdog_timeout)
2021-08-10T12:04:31.9520166Z duthost = duthosts[enum_rand_one_per_hwsku_hostname]
2021-08-10T12:04:31.9523111Z if self.expect(actual_timeout is not None, "Watchdog.arm is not supported"):
2021-08-10T12:04:31.9526175Z if self.expect(isinstance(actual_timeout, int), "actual_timeout appears incorrect"):
2021-08-10T12:04:31.9529562Z if self.expect(actual_timeout != -1, "Failed to arm the watchdog"):
2021-08-10T12:04:31.9532668Z self.expect(actual_timeout >= watchdog_timeout, "Actual watchdog timeout {} seconds appears wrong, should be equal or greater than {} seconds".format(actual_timeout, watchdog_timeout))
2021-08-10T12:04:31.9535428Z
2021-08-10T12:04:31.9537690Z watchdog_status = watchdog.is_armed(platform_api_conn)
2021-08-10T12:04:31.9540344Z if self.expect(watchdog_status is not None, "Failed to retrieve watchdog status"):
2021-08-10T12:04:31.9542968Z self.expect(watchdog_status is True, "Watchdog is not armed.")
2021-08-10T12:04:31.9545429Z
2021-08-10T12:04:31.9547815Z remaining_time = watchdog.get_remaining_time(platform_api_conn)
2021-08-10T12:04:31.9550269Z
2021-08-10T12:04:31.9552647Z if self.expect(remaining_time is not None, "Failed to get the remaining time of watchdog"):
2021-08-10T12:04:31.9555334Z if self.expect(isinstance(remaining_time, int), "remaining_time appears incorrect"):
2021-08-10T12:04:31.9558560Z self.expect(remaining_time <= actual_timeout, "Watchdog remaining_time {} seconds appears wrong compared to watchdog timeout {} seocnds".format(remaining_time, actual_timeout))
2021-08-10T12:04:31.9561559Z
2021-08-10T12:04:31.9563752Z watchdog_status = watchdog.disarm(platform_api_conn)
2021-08-10T12:04:31.9566545Z if self.expect(watchdog_status is not None, "Watchdog.disarm is not supported"):
2021-08-10T12:04:31.9569614Z self.expect(watchdog_status is True, "Failed to disarm the watchdog")
2021-08-10T12:04:31.9572033Z
2021-08-10T12:04:31.9574288Z watchdog_status = watchdog.is_armed(platform_api_conn)
2021-08-10T12:04:31.9577172Z if self.expect(watchdog_status is not None, "Failed to check the watchdog status"):
2021-08-10T12:04:31.9579886Z self.expect(watchdog_status is False, "Watchdog is not disarmed")
2021-08-10T12:04:31.9582384Z
2021-08-10T12:04:31.9584673Z remaining_time = watchdog.get_remaining_time(platform_api_conn)
2021-08-10T12:04:31.9587432Z if self.expect(remaining_time is not None, "Failed to get the remaining time of watchdog"):
2021-08-10T12:04:31.9590456Z self.expect(remaining_time is -1, "Watchdog remaining_time {} seconds is wrong for disarmed state".format(remaining_time))
2021-08-10T12:04:31.9592848Z
2021-08-10T12:04:31.9595264Z res = localhost.wait_for(host=duthost.mgmt_ip, port=22, state="stopped", delay=5, timeout=watchdog_timeout + TIMEOUT_DEVIATION, module_ignore_errors=True)
2021-08-10T12:04:31.9598076Z
2021-08-10T12:04:31.9600713Z self.expect('Timeout' in res.get('msg', ''), "unexpected disconnection from dut")
2021-08-10T12:04:31.9603229Z > self.assert_expectations()
2021-08-10T12:04:31.9604139Z
2021-08-10T12:04:31.9614114Z actual_timeout = 10
2021-08-10T12:04:31.9616988Z conf = OrderedDict([('valid_timeout', 10), ('greater_timeout', 100), ('too_big_timeout', 660)])
2021-08-10T12:04:31.9619615Z duthost = str2-7050cx3-acs-03
2021-08-10T12:04:31.9622056Z duthosts = <tests.common.devices.duthosts.DutHosts object at 0x7f76b9ad69d0>
2021-08-10T12:04:31.9624610Z enum_rand_one_per_hwsku_hostname = 'str2-7050cx3-acs-03'
2021-08-10T12:04:31.9627066Z localhost = <tests.common.devices.local.Localhost object at 0x7f76b83d9b50>
2021-08-10T12:04:31.9629573Z platform_api_conn = <httplib.HTTPConnection instance at 0x7f76a22f16e0>
2021-08-10T12:04:31.9631922Z remaining_time = 0
2021-08-10T12:04:31.9634813Z res = {u'failed': True, '_ansible_no_log': False, u'invocation': {u'module_args': {u...t when waiting for 10.3.146.185:22 to stop.', 'changed': False, u'elapsed': 12}
2021-08-10T12:04:31.9637941Z self = <test_watchdog.TestWatchdogApi object at 0x7f76b9ad6190>
2021-08-10T12:04:31.9640418Z watchdog_status = False
2021-08-10T12:04:31.9642627Z watchdog_timeout = 10
2021-08-10T12:04:31.9643409Z
2021-08-10T12:04:31.9645678Z platform_tests/api/test_watchdog.py:120:
2021-08-10T12:04:31.9648275Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2021-08-10T12:04:31.9649443Z
2021-08-10T12:04:31.9651558Z self = <test_watchdog.TestWatchdogApi object at 0x7f76b9ad6190>
2021-08-10T12:04:31.9652550Z
2021-08-10T12:04:31.9654622Z def assert_expectations(self):
2021-08-10T12:04:31.9656715Z """
2021-08-10T12:04:31.9658927Z Checks if there are any error messages waiting in failed_expectations.
2021-08-10T12:04:31.9661366Z If so, it will fail an assert and pass a concatenation of all pending
2021-08-10T12:04:31.9663754Z error messages. It will also clear failed_expectations to prepare it
2021-08-10T12:04:31.9666041Z for the next use.
2021-08-10T12:04:31.9668087Z """
2021-08-10T12:04:31.9670173Z if len(self.failed_expectations) > 0:
2021-08-10T12:04:31.9672348Z err_msg = ", ".join(self.failed_expectations)
2021-08-10T12:04:31.9674887Z # TODO: When we move to Python 3.3+, we can use self.failed_expectations.clear() instead
2021-08-10T12:04:31.9677638Z del self.failed_expectations[:]
2021-08-10T12:04:31.9680121Z > pytest_assert(False, err_msg)
2021-08-10T12:04:31.9682604Z E Failed: Watchdog remaining_time 0 seconds is wrong for disarmed state
2021-08-10T12:04:31.9683628Z
2021-08-10T12:04:31.9686212Z err_msg = 'Watchdog remaining_time 0 seconds is wrong for disarmed state'
2021-08-10T12:04:31.9689023Z self = <test_watchdog.TestWatchdogApi object at 0x7f76b9ad6190>

Describe the results you expected:

platform_tests/api/test_watchdog.py::TestWatchdogApi::test_arm_disarm_states[str2-7050cx3-acs-03] PASSED [ 14%]

Output of show version:

(paste your output here)

Output of show techsupport:

(paste your output here or download and attach the file here )

Additional information you deem important (e.g. issue happens only occasionally):

@Staphylo
Copy link
Collaborator

I believe this issue goes in pair with #8440 as this test requires get_remaining_time to work properly.
Fixing get_remaining_time would solve this problem.
Let me know if you're fine with ignoring this failure of if you would prefer a cherry-pick of the fix.

@sujinmkang sujinmkang linked a pull request Aug 20, 2021 that will close this issue
sujinmkang pushed a commit that referenced this issue Aug 20, 2021
Fix Chassis.get_name to return the same value than what's in platform.json
Fix Chassis.get_system_eeprom_info when running from within pmon.
Fix Watchdog.get_remaining_time (fixes [202012 platform_tests] TestWatchdogApi::test_remaining_time failure on vms20-t1-7050cx3-3.1 #8440 and [ 202012 platform_tests ] TestWatchdogApi::test_arm_disarm_states failure on vms20-t1-7050cx3-3.1 #8439)
Implement missing thermal infos and conditions (fixes [202012 platform_tests] test_platform_info.py::test_thermal_control_psu_absence error #8453)
Fix Chassis.set_status_led return value (fixes [2020 platform_tests] TestChassisApi::test_status_led failure on vms20-t0-7050cx3-1  #8464)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants