Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for returning failure reason if config_system_checks_pa…
…ssed fails (#5975) What is the motivation for this PR? One of the tasks performed by config_system_checks_passed definition is to check if the dut is running. This is done by executing the command "systemctl is-system-running". It returns "False" If the dut is not running but it does not check why the dut is not running. We need to add support for checking the failure reason How did you do it? Execute the command "systemctl is-system-running". Pass if dut is running. Execute the command "systemctl list-units --state=failed" if dut is not running. This will provide the failure reason. Example of failure reason: In this case tacacs-config.timer loaded failed base.py:82 /data/tests/common/devices/multi_asic.py::_run_on_asics#100: [ixre-cpm-chassis10] AnsibleModule::shell Result => {"stderr_lines": [], "cmd": "systemctl list-units --state=failed", "end": "2022-07-09 10:12:18.720054", "_ansible_no_log": false, "stdout": "UNIT LOAD ACTIVE SUB DESCRIPTION\n\u25cf tacacs-config.timer loaded failed failed Delays tacacs apply until SONiC has started\n\n LOAD = Reflects whether the unit definition was properly loaded.\nACTIVE = The high-level unit activation state, i.e. generalization of SUB.\n SUB = The low-level unit activation state, values depend on unit type.\n1 loaded units listed." How did you verify/test it? Tested the code on a dut when it was in the "running" state Tested the code on a dut when it was in the "degraded" state
- Loading branch information