Skip to content

Commit

Permalink
Merge pull request autotest#5143 from bskjois/domif
Browse files Browse the repository at this point in the history
Fix for domifstat and domblkstat when libvirtd is off
  • Loading branch information
chunfuwen committed Sep 5, 2023
2 parents 562c1c5 + e94e7e9 commit 46ac7ab
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion libvirt/tests/src/virsh_cmd/monitor/virsh_domblkstat.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import logging as log
from virttest import virsh
from virttest import libvirt_xml
from virttest import utils_libvirtd
from virttest import libvirt_version

logging = log.getLogger('avocado.' + __name__)


def run(test, params, env):
Expand Down Expand Up @@ -61,7 +65,11 @@ def run(test, params, env):
# check status_error
if status_error == "yes":
if status == 0 or err == "":
test.fail("Run successfully with wrong command!")
if libvirt_version.version_compare(5, 6, 0):
logging.info("From libvirt version 5.6.0 libvirtd is "
"restarted and command should succeed")
else:
test.fail("Run successfully with wrong command!")
elif status_error == "no":
if status != 0 or output == "":
test.fail("Run failed with right command")
10 changes: 9 additions & 1 deletion libvirt/tests/src/virsh_cmd/monitor/virsh_domifstat.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import logging as log
from xml.dom.minidom import parseString

from avocado.utils import process

from virttest import virsh
from virttest import utils_libvirtd
from virttest import libvirt_version

logging = log.getLogger('avocado.' + __name__)


def run(test, params, env):
Expand Down Expand Up @@ -82,7 +86,11 @@ def get_interface(guest_name):
# check status_error
if status_error == "yes":
if status == 0:
test.fail("Run successfully with wrong command!")
if libvirt_version.version_compare(5, 6, 0):
logging.info("From libvirt version 5.6.0 libvirtd is "
"restarted and command should succeed")
else:
test.fail("Run successfully with wrong command!")
elif status_error == "no":
if status != 0:
test.fail("Run failed with right command")

0 comments on commit 46ac7ab

Please sign in to comment.