diff --git a/tests/conftest.py b/tests/conftest.py index 35a96f0007cf..47bf9369b452 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -600,7 +600,7 @@ def restart(self) -> None: self.ctn_restart() self.check_ready_status_and_init_db() - def runcmd(self, cmd: str) -> Tuple[int, str]: + def runcmd(self, cmd: str, include_stderr=True) -> Tuple[int, str]: res = self.ctn.exec_run(cmd) exitcode = res.exit_code out = res.output.decode("utf-8") diff --git a/tests/test_fdb.py b/tests/test_fdb.py index 2f9067a5999c..06c79f230fd0 100644 --- a/tests/test_fdb.py +++ b/tests/test_fdb.py @@ -229,7 +229,7 @@ def test_FdbWarmRestartNotifications(self, dvs, testlog): dvs.warm_restart_swss("true") # freeze orchagent for warm restart - (exitcode, result) = dvs.runcmd("/usr/bin/orchagent_restart_check") + (exitcode, result) = dvs.runcmd("/usr/bin/orchagent_restart_check", include_stderr=False) assert result == "RESTARTCHECK succeeded\n" time.sleep(2) diff --git a/tests/test_port_an.py b/tests/test_port_an.py index 9c004aa790fc..e8956aee2af8 100644 --- a/tests/test_port_an.py +++ b/tests/test_port_an.py @@ -258,7 +258,7 @@ def test_PortAutoNegWarm(self, dvs, testlog): dvs.warm_restart_swss("true") # freeze orchagent for warm restart - (exitcode, result) = dvs.runcmd("/usr/bin/orchagent_restart_check") + (exitcode, result) = dvs.runcmd("/usr/bin/orchagent_restart_check", include_stderr=False) assert result == "RESTARTCHECK succeeded\n" time.sleep(2) diff --git a/tests/test_port_lt.py b/tests/test_port_lt.py index 3ec51ed68b11..0da6abb071e8 100644 --- a/tests/test_port_lt.py +++ b/tests/test_port_lt.py @@ -103,7 +103,7 @@ def test_PortLinkTrainingWarm(self, dvs, testlog): assert exitcode == 0 # freeze orchagent for warm restart - (exitcode, result) = dvs.runcmd("/usr/bin/orchagent_restart_check") + (exitcode, result) = dvs.runcmd("/usr/bin/orchagent_restart_check", include_stderr=False) assert result == "RESTARTCHECK succeeded\n" time.sleep(2) diff --git a/tests/test_warm_reboot.py b/tests/test_warm_reboot.py index 9447dc55edf1..b2edc4258789 100644 --- a/tests/test_warm_reboot.py +++ b/tests/test_warm_reboot.py @@ -891,23 +891,23 @@ def test_OrchagentWarmRestartReadyCheck(self, dvs, testlog): time.sleep(1) # Should fail, since neighbor for next 20.0.0.1 has not been not resolved yet - (exitcode, result) = dvs.runcmd("/usr/bin/orchagent_restart_check") + (exitcode, result) = dvs.runcmd("/usr/bin/orchagent_restart_check", include_stderr=False) assert result == "RESTARTCHECK failed\n" # Should succeed, the option for skipPendingTaskCheck -s and noFreeze -n have been provided. # Wait up to 500 milliseconds for response from orchagent. Default wait time is 1000 milliseconds. - (exitcode, result) = dvs.runcmd("/usr/bin/orchagent_restart_check -n -s -w 500") + (exitcode, result) = dvs.runcmd("/usr/bin/orchagent_restart_check -n -s -w 500", include_stderr=False) assert result == "RESTARTCHECK succeeded\n" # Remove unfinished routes ps._del("3.3.3.0/24") time.sleep(1) - (exitcode, result) = dvs.runcmd("/usr/bin/orchagent_restart_check") + (exitcode, result) = dvs.runcmd("/usr/bin/orchagent_restart_check", include_stderr=False) assert result == "RESTARTCHECK succeeded\n" # Should fail since orchagent has been frozen at last step. - (exitcode, result) = dvs.runcmd("/usr/bin/orchagent_restart_check -n -s -w 500") + (exitcode, result) = dvs.runcmd("/usr/bin/orchagent_restart_check -n -s -w 500", include_stderr=False) assert result == "RESTARTCHECK failed\n" # Cleaning previously pushed route-entry to ease life of subsequent testcases.