Skip to content

Commit 8ad8006

Browse files
committed
initial commit.
1 parent 2b19383 commit 8ad8006

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/gnmi/test_gnoi_system.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ def test_gnoi_system_time(duthosts, rand_one_dut_hostname, localhost):
3535
pytest_assert("time" in msg_json, "System.Time API did not return time")
3636

3737

38+
def test_gnoi_system_reboot(duthosts, rand_one_dut_hostname, localhost):
39+
"""
40+
Verify the gNOI System Reboot API triggers a reboot and the device comes back online.
41+
"""
42+
duthost = duthosts[rand_one_dut_hostname]
43+
44+
# Trigger reboot
45+
ret, msg = gnoi_request(duthost, localhost, "Reboot", '{"method": 1}')
46+
pytest_assert(ret == 0, "System.Reboot API reported failure (rc = {}) with message: {}".format(ret, msg))
47+
logging.info("System.Reboot API returned msg: {}".format(msg))
48+
49+
3850
def extract_first_json_substring(s):
3951
"""
4052
Extract the first JSON substring from a given string.

0 commit comments

Comments
 (0)