References: jsc#SLE-6262, fate#327048: KVM: Boot Configuration Override (virt-manager) Subject: tests: virt-xml: Add test cases for --start option From: Marc Hartmayer mhartmay@linux.ibm.com Tue Feb 26 10:56:44 2019 +0100 Date: Wed Mar 6 13:15:38 2019 -0500: Git: 908b8e8d7c3663ca791b068f2f03234e31281bbc The test cases verify that: + --start works + --define --start works + --no-define --start works + --start works in combination with --add and --remove + combination of --start --update isn't valid + combination of --define --no-define --start isn't valid Signed-off-by: Marc Hartmayer Reviewed-by: Boris Fiuczynski diff --git a/tests/cli-test-xml/compare/virt-xml-add-disk-basic-start.xml b/tests/cli-test-xml/compare/virt-xml-add-disk-basic-start.xml new file mode 100644 index 00000000..0071d9e7 --- /dev/null +++ b/tests/cli-test-xml/compare/virt-xml-add-disk-basic-start.xml @@ -0,0 +1,11 @@ + + + ++ ++ ++ ++ + + + +Domain 'test-state-shutoff' started successfully. \ No newline at end of file diff --git a/tests/cli-test-xml/compare/virt-xml-add-disk-create-storage-start.xml b/tests/cli-test-xml/compare/virt-xml-add-disk-create-storage-start.xml new file mode 100644 index 00000000..6a02dcc3 --- /dev/null +++ b/tests/cli-test-xml/compare/virt-xml-add-disk-create-storage-start.xml @@ -0,0 +1,11 @@ + + + ++ ++ ++ ++ + + + +Domain 'test-state-shutoff' started successfully. \ No newline at end of file diff --git a/tests/cli-test-xml/compare/virt-xml-add-host-device-start.xml b/tests/cli-test-xml/compare/virt-xml-add-host-device-start.xml new file mode 100644 index 00000000..b3db5279 --- /dev/null +++ b/tests/cli-test-xml/compare/virt-xml-add-host-device-start.xml @@ -0,0 +1,14 @@ + + + ++ ++ ++ ++ ++ ++ + + + +Domain 'test-state-shutoff' defined successfully. +Domain 'test-state-shutoff' started successfully. \ No newline at end of file diff --git a/tests/cli-test-xml/compare/virt-xml-remove-disk-path-start.xml b/tests/cli-test-xml/compare/virt-xml-remove-disk-path-start.xml new file mode 100644 index 00000000..e04db8fb --- /dev/null +++ b/tests/cli-test-xml/compare/virt-xml-remove-disk-path-start.xml @@ -0,0 +1,20 @@ + poweroff + + /usr/lib/xen/bin/qemu-dm +- +- +- +- +- +- +- +- +- +- +- +- + + + + +Domain 'test-state-shutoff' started successfully. \ No newline at end of file diff --git a/tests/cli-test-xml/compare/virt-xml-start-select-disk-bootorder.xml b/tests/cli-test-xml/compare/virt-xml-start-select-disk-bootorder.xml new file mode 100644 index 00000000..280d9fc5 --- /dev/null +++ b/tests/cli-test-xml/compare/virt-xml-start-select-disk-bootorder.xml @@ -0,0 +1,33 @@ + + + +- ++ + + + + + +- ++ + + + + +- ++ +
+ + +@@ + + + +- ++ + + + + +Domain 'test-state-shutoff' defined successfully. +Domain 'test-state-shutoff' started successfully. \ No newline at end of file diff --git a/tests/cli-test-xml/compare/virt-xml-start-select-disk-bootorder2.xml b/tests/cli-test-xml/compare/virt-xml-start-select-disk-bootorder2.xml new file mode 100644 index 00000000..1144f4c5 --- /dev/null +++ b/tests/cli-test-xml/compare/virt-xml-start-select-disk-bootorder2.xml @@ -0,0 +1,32 @@ + + + +- ++ + + + + + +- ++ + + + + +- ++ +
+ + +@@ + + + +- ++ + + + + +Domain 'test-state-shutoff' started successfully. \ No newline at end of file diff --git a/tests/clitest.py b/tests/clitest.py index b4f41b79..1c3cd5a5 100644 --- a/tests/clitest.py +++ b/tests/clitest.py @@ -893,6 +893,7 @@ c = vixml.add_category("misc", "") c.add_valid("--help") # basic --help test c.add_valid("--sound=? --tpm=?") # basic introspection test c.add_valid("test-state-shutoff --edit --update --boot menu=on") # --update with inactive VM, should work but warn +c.add_invalid("test-state-shutoff --edit --update --boot menu=on --start") c.add_invalid("test --edit --hostdev driver_name=vfio") # Guest has no hostdev to edit c.add_invalid("test --edit --cpu host-passthrough --boot hd,network") # Specified more than 1 option c.add_invalid("test --edit") # specified no edit option @@ -968,6 +969,12 @@ c.add_compare("--edit /tmp/foobar2 --disk shareable=off,readonly=on", "edit-sele c.add_compare("--edit mac=00:11:7f:33:44:55 --network target=nic55", "edit-select-network-mac") c.add_compare("--edit target=hda --disk boot_order=1", "edit-select-disk-bootorder") +c = vixml.add_category("edit and start selection", "test-state-shutoff --print-diff --start") +c.add_compare("--define --edit target=vda --disk boot_order=1", "start-select-disk-bootorder") +c.add_invalid("--define --no-define --edit target=vda --disk boot_order=1") +c.add_compare("--edit target=vda --disk boot_order=1", "start-select-disk-bootorder2") +c.add_compare("--no-define --edit target=vda --disk boot_order=1", "start-select-disk-bootorder2") + c = vixml.add_category("edit selection 2", "test-collide --print-diff --define") c.add_compare("--edit target=hda --disk boot_order=1", "edit-select-disk-bootorder2") @@ -995,6 +1002,16 @@ c.add_compare("--remove-device --disk /dev/null", "remove-disk-path") c.add_compare("--remove-device --video all", "remove-video-all", check_version="1.3.3") # check_version=video primary= attribute c.add_compare("--remove-device --host-device 0x04b3:0x4485", "remove-hostdev-name", check_version="1.2.11") # check_version=video ram output change +c = vixml.add_category("add/rm devices and start", "test-state-shutoff --print-diff --start") +c.add_invalid("--add-device --pm suspend_to_disk=yes") # --add-device without a device +c.add_invalid("--remove-device --clock utc") # --remove-device without a dev +# one test in combination with --define +c.add_compare("--define --add-device --host-device usb_device_4b3_4485_noserial", "add-host-device-start") +# all other test cases without +c.add_compare("--add-device --disk %(EXISTIMG1)s,bus=virtio,target=vdf", "add-disk-basic-start") +c.add_compare("--add-device --disk %(NEWIMG1)s,size=.01", "add-disk-create-storage-start") +c.add_compare("--remove-device --disk /dev/null", "remove-disk-path-start") + c = vixml.add_category("add/rm devices OS KVM", "--connect %(URI-KVM)s test --print-diff --define") c.add_compare("--add-device --disk %(EXISTIMG1)s", "kvm-add-disk-os-from-xml") # Guest OS (none) from XML c.add_compare("--add-device --disk %(EXISTIMG1)s --os-variant fedora28", "kvm-add-disk-os-from-cmdline") # Guest OS (fedora) provided on command line diff --git a/tests/testsuite.xml b/tests/testsuite.xml index fa0a077f..2e6f0fd6 100644 --- a/tests/testsuite.xml +++ b/tests/testsuite.xml @@ -289,6 +289,64 @@ 1048576 /tmp/bootfoo 5 + + + + + + 204800 + 409600 + 12345678-1234-1234-1234-123456789012 + + hvm + + + + + + + + + + + destroy + restart + destroy + poweroff + + /usr/lib/xen/bin/qemu-dm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +