Skip to content

Commit

Permalink
Add test for halt system
Browse files Browse the repository at this point in the history
  • Loading branch information
vvolam committed Sep 15, 2024
1 parent 5708752 commit 9ea5906
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/test_gnoi.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ def test_gnoi_reboot(self):
assert ret == 0, 'Fail to read counter'
assert new_cnt == old_cnt+1, 'DBUS API is not invoked'

def test_gnoi_reboot_halt(self):
ret, old_cnt = gnmi_dump('DBUS config reload')
assert ret == 0, 'Fail to read counter'

ret, msg = gnoi_reboot(3, 0, 'Test halt system')
assert ret == 0, msg

ret, new_cnt = gnmi_dump('DBUS halt system')
assert ret == 0, 'Fail to read counter'
assert new_cnt == old_cnt+1, 'DBUS API is not invoked'

def test_gnoi_rebootstatus(self):
ret, msg = gnoi_rebootstatus()
assert ret != 0, 'RebootStatus should fail' + msg
Expand Down

0 comments on commit 9ea5906

Please sign in to comment.