Skip to content

Commit

Permalink
Merge pull request #3809 from cliping/listen
Browse files Browse the repository at this point in the history
Add a function to check listen address
  • Loading branch information
chloerh authored Dec 7, 2023
2 parents 7c0bf3e + 9f5a18b commit 1375b39
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions virttest/utils_libvirt/libvirt_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,3 +342,14 @@ def change_tcp_config(expected_dict):
tcp_retries2, tcp_fin_timeout))
LOG.debug("Change TCP config: %s", cmd)
process.run(cmd, shell=True, ignore_status=False)


def check_listen_address(params):
"""
Check listen address by ss command
:param params: dictionary with the test parameter, get listen address
"""
listen_address = params.get("listen_address")

process.run(f"ss -tnap|grep qemu-kvm| grep '{listen_address}'", shell=True, ignore_status=False)

0 comments on commit 1375b39

Please sign in to comment.