diff --git a/pfcwd/main.py b/pfcwd/main.py index 1f8ec2293e..c3b92fd223 100644 --- a/pfcwd/main.py +++ b/pfcwd/main.py @@ -242,7 +242,7 @@ def start(self, action, restoration_time, ports, detection_time): click.echo("Failed to run command, invalid options:") for opt in invalid_ports: click.echo(opt) - exit() + exit(1) self.start_cmd(action, restoration_time, ports, detection_time) diff --git a/tests/pfcwd_test.py b/tests/pfcwd_test.py index b0af050233..c150c0568b 100644 --- a/tests/pfcwd_test.py +++ b/tests/pfcwd_test.py @@ -255,7 +255,7 @@ def test_pfcwd_start_ports_invalid(self): obj=db ) print(result.output) - assert result.exit_code == 0 + assert result.exit_code == 1 assert result.output == pfcwd_show_start_config_output_fail @classmethod @@ -447,7 +447,7 @@ def test_pfcwd_start_ports_masic_invalid(self): obj=db ) print(result.output) - assert result.exit_code == 0 + assert result.exit_code == 1 assert result.output == show_pfc_config_start_fail # get config after the command, config shouldn't change @@ -500,4 +500,4 @@ def teardown_class(cls): import mock_tables.mock_single_asic importlib.reload(mock_tables.mock_single_asic) import pfcwd.main - importlib.reload(pfcwd.main) \ No newline at end of file + importlib.reload(pfcwd.main)