Skip to content

[common/reboot] incorrect assertion on warmboot-finalizer state #2147

@stepanblyschak

Description

@stepanblyschak

Description

Assertion at https://github.com/Azure/sonic-mgmt/blob/master/tests/common/reboot.py#L147 can lead to a failure if wait time is enough for warmboot-finalizer to finish.

if reboot_type == 'warm': 
            logger.info('waiting for warmboot-finalizer service to finish') 
            res = duthost.command('systemctl is-active warmboot-finalizer.service',module_ignore_errors=True) 
            finalizer_state = res['stdout'].strip() 
            logger.info('warmboot finalizer service state {}'.format(finalizer_state)) 
           assert finalizer_state == 'activating' 
           AssertionError

delay = 10
dut_datetime = datetime.datetime(2020, 8, 3, 23, 8, 1)
dut_ip = u'10.210.25.102'
duthost = <tests.common.devices.SonicHost object at 0x7f8ea1615690>
execute_reboot_command = <function execute_reboot_command at 0x7f8e9ee39e60>
execute_reboot_helper = <function execute_reboot_helper at 0x7f8e9f285410>
finalizer_state = 'inactive'
localhost = <tests.common.devices.Localhost object at 0x7f8ea5d99290>
pool = <multiprocessing.pool.ThreadPool object at 0x7f8e9f535950>
reboot_command = 'warm-reboot'
reboot_ctrl = {'cause': 'warm-reboot', 'command': 'warm-reboot', 'test_reboot_cause_only': False, 'timeout': 300, ...}
reboot_helper = None
reboot_kwargs = None
reboot_res = <multiprocessing.pool.ApplyResult object at 0x7f8e9eb93e90>
reboot_type = 'warm'
res = {'stderr_lines': [], u'cmd': [u'systemctl', u'is-active', u'warmboot-finalizer...stdin': None}}, 'stdout_lines': [u'inactive'], u'msg': u'non-zero return code'}
timeout = 300
wait = 90

Steps to reproduce the issue:
1.
2.
3.

Describe the results you received:

Describe the results you expected:

There should be no such assetion.

Additional information you deem important:

**Output of `show version`:**

```
(paste your output here)
```

**Attach debug file `sudo generate_dump`:**

```
(paste your output here)
```

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions