Skip to content

Commit

Permalink
Add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
liuh-80 committed Jan 10, 2025
1 parent 8083c86 commit a8835c4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_zmq.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,20 @@ def test_vrf(self, dvs):
dvs.runcmd("cp /usr/bin/orchagent.sh_vrf_ut_backup /usr/bin/orchagent.sh")
dvs.stop_swss()
dvs.start_swss()

def test_heartbeat(self, dvs):
# Improve test code coverage, change orchagent to disable heartbeat
dvs.runcmd("cp /usr/bin/orchagent.sh /usr/bin/orchagent.sh_vrf_ut_backup")
dvs.runcmd("sed -i.bak 's/\/usr\/bin\/orchagent /\/usr\/bin\/orchagent -I 0 /g' /usr/bin/orchagent.sh")
dvs.stop_swss()
dvs.start_swss()

# wait orchagent start
time.sleep(3)
process_statue = dvs.runcmd("ps -ef")
zmq_logger.debug("Process status: {}".format(process_statue))

# revert change
dvs.runcmd("cp /usr/bin/orchagent.sh_vrf_ut_backup /usr/bin/orchagent.sh")
dvs.stop_swss()
dvs.start_swss()

0 comments on commit a8835c4

Please sign in to comment.