diff --git a/qemu/tests/cfg/set_link.cfg b/qemu/tests/cfg/set_link.cfg index f29b33a54522103668f0258e3228bed427a39579..2ac0fdab9048af55b27fe24de25303b5129dc569 100644 --- a/qemu/tests/cfg/set_link.cfg +++ b/qemu/tests/cfg/set_link.cfg @@ -16,11 +16,6 @@ - status_on: only virtio_net nic_extra_params = ",status=on" - - status_off: - only virtio_net - nic_extra_params = ",status=off" - down-status = "unknown" - up-status = "unknown" variants: - reboot_shell: reboot_method = shell diff --git a/qemu/tests/set_link.py b/qemu/tests/set_link.py index b4b846c53529f049b2160ab5b834907c77941e5b..d1f87e3c869c7dfb6c029e797b863b13e6f53ad3 100644 --- a/qemu/tests/set_link.py +++ b/qemu/tests/set_link.py @@ -177,21 +177,22 @@ def run(test, params, env): finally: session.close() - def set_link_test(linkid, link_up, expect_status, - operstate_always_up=False, change_queues=False): + def set_link_test(linkid, link_up, change_queues, operstate_always_up=False): """ Issue set_link commands and test its function :param linkid: id of netdev or devices to be tested :param link_up: flag linkid is up or down - :param expect_status : expect guest operstate status" + :param change_queues: whether run change mq queues, only effect on + linux guest with mq nic. :param operstate_always_up: when linkid is netdev id, guest interface operstate will never change, need set it to True. - :param change_queues: whether run change mq queues, only effect on - linux guest with mq nic. - """ + if link_up: + expect_status = "up" + else: + expect_status = "down" vm.set_link(linkid, up=link_up) time.sleep(1) error_context.context("Check guest interface operstate", logging.info) @@ -249,27 +250,23 @@ def run(test, params, env): session.close() - expect_down_status = params.get("down-status", "down") - expect_up_status = params.get("up-status", "up") operstate_always_up = params.get("operstate_always_up", "no") == "yes" error_context.context("Disable guest netdev link '%s' by set_link" % netdev_id, logging.info) - set_link_test(netdev_id, False, expect_down_status, operstate_always_up, - change_queues) + set_link_test(netdev_id, False, change_queues, operstate_always_up) error_context.context("Re-enable guest netdev link '%s' by set_link" % netdev_id, logging.info) - set_link_test(netdev_id, True, expect_up_status, operstate_always_up, - change_queues) + set_link_test(netdev_id, True, change_queues, operstate_always_up) error_context.context("Disable guest nic device '%s' by set_link" % device_id, logging.info) - set_link_test(device_id, False, expect_down_status, False, change_queues) + set_link_test(device_id, False, change_queues) error_context.context("Re-enable guest nic device '%s' by set_link" % device_id, logging.info) - set_link_test(device_id, True, expect_up_status, False, change_queues) + set_link_test(device_id, True, change_queues) error_context.context("Do file transfer after setlink on and off", logging.info)