From: Markus Frank <m.frank@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server v4 3/5] added test-cases for new machine-syntax & viommu
Date: Fri, 25 Nov 2022 15:08:55 +0100 [thread overview]
Message-ID: <20221125140857.121622-4-m.frank@proxmox.com> (raw)
In-Reply-To: <20221125140857.121622-1-m.frank@proxmox.com>
added a few test-cases to test the new machine parameter with viommu
Signed-off-by: Markus Frank <m.frank@proxmox.com>
---
test/cfg2cmd/viommu.conf | 1 +
test/cfg2cmd/viommu.conf.cmd | 23 ++++++++
test/restore-config-expected/401.conf | 14 +++++
test/restore-config-expected/402.conf | 14 +++++
test/restore-config-input/401.conf | 14 +++++
test/restore-config-input/402.conf | 14 +++++
test/run_qemu_restore_config_tests.pl | 2 +-
.../create/qemu-server/401.conf | 32 +++++++++++
.../create/qemu-server/402.conf | 53 +++++++++++++++++++
.../create/qemu-server/401.conf | 14 +++++
.../create/qemu-server/402.conf | 33 ++++++++++++
test/snapshot-test.pm | 6 +++
12 files changed, 219 insertions(+), 1 deletion(-)
create mode 100644 test/cfg2cmd/viommu.conf
create mode 100644 test/cfg2cmd/viommu.conf.cmd
create mode 100644 test/restore-config-expected/401.conf
create mode 100644 test/restore-config-expected/402.conf
create mode 100644 test/restore-config-input/401.conf
create mode 100644 test/restore-config-input/402.conf
create mode 100644 test/snapshot-expected/create/qemu-server/401.conf
create mode 100644 test/snapshot-expected/create/qemu-server/402.conf
create mode 100644 test/snapshot-input/create/qemu-server/401.conf
create mode 100644 test/snapshot-input/create/qemu-server/402.conf
diff --git a/test/cfg2cmd/viommu.conf b/test/cfg2cmd/viommu.conf
new file mode 100644
index 0000000..6925a74
--- /dev/null
+++ b/test/cfg2cmd/viommu.conf
@@ -0,0 +1 @@
+machine: type=q35,viommu=1
diff --git a/test/cfg2cmd/viommu.conf.cmd b/test/cfg2cmd/viommu.conf.cmd
new file mode 100644
index 0000000..24e873d
--- /dev/null
+++ b/test/cfg2cmd/viommu.conf.cmd
@@ -0,0 +1,23 @@
+/usr/bin/kvm \
+ -id 8006 \
+ -name 'vm8006,debug-threads=on' \
+ -no-shutdown \
+ -chardev 'socket,id=qmp,path=/var/run/qemu-server/8006.qmp,server=on,wait=off' \
+ -mon 'chardev=qmp,mode=control' \
+ -chardev 'socket,id=qmp-event,path=/var/run/qmeventd.sock,reconnect=5' \
+ -mon 'chardev=qmp-event,mode=control' \
+ -pidfile /var/run/qemu-server/8006.pid \
+ -daemonize \
+ -smp '1,sockets=1,cores=1,maxcpus=1' \
+ -nodefaults \
+ -boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' \
+ -vnc 'unix:/var/run/qemu-server/8006.vnc,password=on' \
+ -cpu kvm64,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,+lahf_lm,+sep \
+ -m 512 \
+ -device 'intel-iommu,intremap=on,caching-mode=on' \
+ -readconfig /usr/share/qemu-server/pve-q35-4.0.cfg \
+ -device 'usb-tablet,id=tablet,bus=ehci.0,port=1' \
+ -device 'VGA,id=vga,bus=pcie.0,addr=0x1' \
+ -device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
+ -iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
+ -machine 'type=q35+pve0,kernel-irqchip=split'
diff --git a/test/restore-config-expected/401.conf b/test/restore-config-expected/401.conf
new file mode 100644
index 0000000..9400351
--- /dev/null
+++ b/test/restore-config-expected/401.conf
@@ -0,0 +1,14 @@
+bootdisk: scsi0
+cores: 1
+ide2: none,media=cdrom
+memory: 512
+machine: q35,viommu=1
+name: apache
+net0: virtio=92:38:11:FD:ED:87,bridge=vmbr0,firewall=1
+numa: 0
+ostype: l26
+scsi0: target:401/vm-401-disk-0.qcow2,size=4G
+scsihw: virtio-scsi-pci
+smbios1: uuid=ddf91b3f-a597-42be-9a7e-fb6421dcd5cd
+sockets: 1
+vmgenid: 0
diff --git a/test/restore-config-expected/402.conf b/test/restore-config-expected/402.conf
new file mode 100644
index 0000000..73f69cb
--- /dev/null
+++ b/test/restore-config-expected/402.conf
@@ -0,0 +1,14 @@
+bootdisk: scsi0
+cores: 1
+ide2: none,media=cdrom
+memory: 512
+machine: type=q35,viommu=1
+name: apache
+net0: virtio=92:38:11:FD:ED:87,bridge=vmbr0,firewall=1
+numa: 0
+ostype: l26
+scsi0: target:401/vm-402-disk-0.qcow2,size=4G
+scsihw: virtio-scsi-pci
+smbios1: uuid=ddf91b3f-a597-42be-9a7e-fb6421dcd5cd
+sockets: 1
+vmgenid: 0
diff --git a/test/restore-config-input/401.conf b/test/restore-config-input/401.conf
new file mode 100644
index 0000000..9400351
--- /dev/null
+++ b/test/restore-config-input/401.conf
@@ -0,0 +1,14 @@
+bootdisk: scsi0
+cores: 1
+ide2: none,media=cdrom
+memory: 512
+machine: q35,viommu=1
+name: apache
+net0: virtio=92:38:11:FD:ED:87,bridge=vmbr0,firewall=1
+numa: 0
+ostype: l26
+scsi0: target:401/vm-401-disk-0.qcow2,size=4G
+scsihw: virtio-scsi-pci
+smbios1: uuid=ddf91b3f-a597-42be-9a7e-fb6421dcd5cd
+sockets: 1
+vmgenid: 0
diff --git a/test/restore-config-input/402.conf b/test/restore-config-input/402.conf
new file mode 100644
index 0000000..73f69cb
--- /dev/null
+++ b/test/restore-config-input/402.conf
@@ -0,0 +1,14 @@
+bootdisk: scsi0
+cores: 1
+ide2: none,media=cdrom
+memory: 512
+machine: type=q35,viommu=1
+name: apache
+net0: virtio=92:38:11:FD:ED:87,bridge=vmbr0,firewall=1
+numa: 0
+ostype: l26
+scsi0: target:401/vm-402-disk-0.qcow2,size=4G
+scsihw: virtio-scsi-pci
+smbios1: uuid=ddf91b3f-a597-42be-9a7e-fb6421dcd5cd
+sockets: 1
+vmgenid: 0
diff --git a/test/run_qemu_restore_config_tests.pl b/test/run_qemu_restore_config_tests.pl
index 1e1e807..2221abe 100755
--- a/test/run_qemu_restore_config_tests.pl
+++ b/test/run_qemu_restore_config_tests.pl
@@ -25,7 +25,7 @@ $pve_cluster_module->mock(
);
# NOTE update when you add/remove tests
-plan tests => 4;
+plan tests => 6;
my $cfs_mock = Test::MockModule->new("PVE::Cluster");
$cfs_mock->mock(
diff --git a/test/snapshot-expected/create/qemu-server/401.conf b/test/snapshot-expected/create/qemu-server/401.conf
new file mode 100644
index 0000000..56cb71c
--- /dev/null
+++ b/test/snapshot-expected/create/qemu-server/401.conf
@@ -0,0 +1,32 @@
+bootdisk: ide0
+cores: 4
+ide0: local:snapshotable-disk-1,discard=on,size=32G
+ide2: none,media=cdrom
+machine: q35,viommu=1
+memory: 8192
+name: win
+net0: e1000=12:34:56:78:90:12,bridge=somebr0,firewall=1
+numa: 0
+ostype: win7
+parent: test
+smbios1: uuid=01234567-890a-bcde-f012-34567890abcd
+sockets: 1
+vga: qxl
+
+[test]
+#test comment
+bootdisk: ide0
+cores: 4
+ide0: local:snapshotable-disk-1,discard=on,size=32G
+ide2: none,media=cdrom
+machine: q35,viommu=1
+memory: 8192
+name: win
+net0: e1000=12:34:56:78:90:12,bridge=somebr0,firewall=1
+numa: 0
+ostype: win7
+parent: test
+smbios1: uuid=01234567-890a-bcde-f012-34567890abcd
+snaptime: 1234567890
+sockets: 1
+vga: qxl
diff --git a/test/snapshot-expected/create/qemu-server/402.conf b/test/snapshot-expected/create/qemu-server/402.conf
new file mode 100644
index 0000000..ac485ce
--- /dev/null
+++ b/test/snapshot-expected/create/qemu-server/402.conf
@@ -0,0 +1,53 @@
+agent: 1
+bootdisk: ide0
+cores: 4
+ide0: local:snapshotable-disk-1,discard=on,size=32G
+ide2: none,media=cdrom
+memory: 8192
+name: win
+net0: e1000=12:34:56:78:90:12,bridge=somebr0,firewall=1
+numa: 0
+ostype: win7
+parent: test2
+smbios1: uuid=01234567-890a-bcde-f012-34567890abcd
+sockets: 1
+vga: qxl
+
+[test]
+#test comment
+agent: 1
+bootdisk: ide0
+cores: 4
+ide0: local:snapshotable-disk-1,discard=on,size=32G
+ide2: none,media=cdrom
+machine: q35,viommu=1
+memory: 8192
+name: win
+net0: e1000=12:34:56:78:90:12,bridge=somebr0,firewall=1
+numa: 0
+ostype: win7
+smbios1: uuid=01234567-890a-bcde-f012-34567890abcd
+snaptime: 1234567890
+sockets: 1
+vga: qxl
+vmstate: somestorage:state-volume
+
+[test2]
+#test comment
+agent: 1
+bootdisk: ide0
+cores: 4
+ide0: local:snapshotable-disk-1,discard=on,size=32G
+ide2: none,media=cdrom
+memory: 8192
+name: win
+net0: e1000=12:34:56:78:90:12,bridge=somebr0,firewall=1
+numa: 0
+ostype: win7
+parent: test
+runningmachine: q35
+smbios1: uuid=01234567-890a-bcde-f012-34567890abcd
+snaptime: 1234567890
+sockets: 1
+vga: qxl
+vmstate: somestorage:state-volume
diff --git a/test/snapshot-input/create/qemu-server/401.conf b/test/snapshot-input/create/qemu-server/401.conf
new file mode 100644
index 0000000..8feec27
--- /dev/null
+++ b/test/snapshot-input/create/qemu-server/401.conf
@@ -0,0 +1,14 @@
+bootdisk: ide0
+cores: 4
+ide0: local:snapshotable-disk-1,discard=on,size=32G
+ide2: none,media=cdrom
+machine: q35,viommu=1
+memory: 8192
+name: win
+net0: e1000=12:34:56:78:90:12,bridge=somebr0,firewall=1
+numa: 0
+ostype: win7
+parent: test
+smbios1: uuid=01234567-890a-bcde-f012-34567890abcd
+sockets: 1
+vga: qxl
diff --git a/test/snapshot-input/create/qemu-server/402.conf b/test/snapshot-input/create/qemu-server/402.conf
new file mode 100644
index 0000000..72f89ce
--- /dev/null
+++ b/test/snapshot-input/create/qemu-server/402.conf
@@ -0,0 +1,33 @@
+agent: 1
+bootdisk: ide0
+cores: 4
+ide0: local:snapshotable-disk-1,discard=on,size=32G
+ide2: none,media=cdrom
+memory: 8192
+name: win
+net0: e1000=12:34:56:78:90:12,bridge=somebr0,firewall=1
+numa: 0
+ostype: win7
+parent: test
+smbios1: uuid=01234567-890a-bcde-f012-34567890abcd
+sockets: 1
+vga: qxl
+
+[test]
+#test comment
+agent: 1
+bootdisk: ide0
+cores: 4
+ide0: local:snapshotable-disk-1,discard=on,size=32G
+ide2: none,media=cdrom
+machine: q35,viommu=1
+memory: 8192
+name: win
+net0: e1000=12:34:56:78:90:12,bridge=somebr0,firewall=1
+numa: 0
+ostype: win7
+smbios1: uuid=01234567-890a-bcde-f012-34567890abcd
+snaptime: 1234567890
+sockets: 1
+vga: qxl
+vmstate: somestorage:state-volume
diff --git a/test/snapshot-test.pm b/test/snapshot-test.pm
index 50c5857..3fcb0eb 100644
--- a/test/snapshot-test.pm
+++ b/test/snapshot-test.pm
@@ -566,6 +566,12 @@ $vm_mon->{savevm_start} = 1;
printf("Successful snapshot_create with no existing snapshots but set machine type\n");
testcase_create("301", "test", 1, "test comment", "", { "local:snapshotable-disk-1" => "test" });
+printf("Successful snapshot_create with viommu enabled\n");
+testcase_create("401", "test", 0, "test comment", "", { "local:snapshotable-disk-1" => "test" });
+
+printf("Successful snapshot_create with viommu enabled and with one existing snapshots including vmstate\n");
+testcase_create("402", "test2", 1, "test comment", "", { "local:snapshotable-disk-1" => "test2" });
+
$activate_storage_possible = 0;
printf("Expected error for snapshot_create when storage activation is not possible\n");
--
2.30.2
next prev parent reply other threads:[~2022-11-25 14:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-25 14:08 [pve-devel] [PATCH qemu-server v4 0/5] vIOMMU-Feature Markus Frank
2022-11-25 14:08 ` [pve-devel] [PATCH qemu-server v4 1/5] tests: replaced somemachine&someothermachine with q35&pc Markus Frank
2022-11-25 14:08 ` [pve-devel] [PATCH qemu-server v4 2/5] fix #3784: Parameter for guest vIOMMU & machine as property-string Markus Frank
2023-01-13 9:51 ` Wolfgang Bumiller
2022-11-25 14:08 ` Markus Frank [this message]
2022-11-25 14:08 ` [pve-devel] [PATCH docs v4 4/5] added vIOMMU documentation Markus Frank
2023-01-13 10:09 ` Wolfgang Bumiller
2023-01-13 13:31 ` Markus Frank
2023-01-16 10:00 ` Wolfgang Bumiller
2023-01-17 10:55 ` Markus Frank
2023-01-17 15:01 ` Wolfgang Bumiller
2022-11-25 14:08 ` [pve-devel] [PATCH manager v4 5/5] ui: MachineEdit with viommu checkbox Markus Frank
2023-01-12 13:51 ` [pve-devel] [PATCH qemu-server v4 0/5] vIOMMU-Feature Markus Frank
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221125140857.121622-4-m.frank@proxmox.com \
--to=m.frank@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal