Skip to content

Commit

Permalink
gracefully skip the test if process doesn't exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
hdwhdw committed Jan 2, 2025
1 parent e2568f7 commit b5e660f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/gnmi/test_gnoi_killprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@
def test_gnoi_killprocess_then_restart(duthosts, rand_one_dut_hostname, localhost, process, is_valid, expected_msg):
duthost = duthosts[rand_one_dut_hostname]

if process and process != "nonexistent":
pytest_assert(duthost.is_host_service_running(process),
"{} should be running before KillProcess test attempts to kill this process".format(process))
if process and not duthost.is_host_service_running(process):
pytest.skip("{} is not running".format(process))

request_kill_json_data = '{{"name": "{}", "signal": 1}}'.format(process)
ret, msg = gnoi_request(duthost, localhost, "KillProcess", request_kill_json_data)
Expand Down

0 comments on commit b5e660f

Please sign in to comment.