From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 7C54C1FF166 for ; Fri, 25 Oct 2024 17:04:02 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 4F8EF31F5D; Fri, 25 Oct 2024 17:03:08 +0200 (CEST) From: Daniel Herzig To: pve-devel@lists.proxmox.com Date: Fri, 25 Oct 2024 17:02:40 +0200 Message-Id: <20241025150243.134466-10-d.herzig@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241025150243.134466-1-d.herzig@proxmox.com> References: <20241025150243.134466-1-d.herzig@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.012 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH qemu-server 9/12] test: cfg2cmd: add tests for testing the iso required parameter X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" This adds tests for the errors and warnings issued by PVE::QemuServer::eject_unrequired_isos. Empty cmd files were added for the test configurations that are not expected to have any output (as they die before a command is prepared): * ide-required-iso-missing.conf * ide-required-iso-offline-nfs.conf Signed-off-by: Daniel Herzig --- test/cfg2cmd/ide-required-iso-missing.conf | 12 ++++++ .../cfg2cmd/ide-required-iso-missing.conf.cmd | 0 .../cfg2cmd/ide-required-iso-offline-nfs.conf | 12 ++++++ .../ide-required-iso-offline-nfs.conf.cmd | 0 test/cfg2cmd/ide-required.conf | 14 +++++++ test/cfg2cmd/ide-required.conf.cmd | 39 +++++++++++++++++++ test/cfg2cmd/ide-unrequired-iso-missing.conf | 12 ++++++ .../ide-unrequired-iso-missing.conf.cmd | 33 ++++++++++++++++ .../ide-unrequired-iso-offline-nfs.conf | 12 ++++++ .../ide-unrequired-iso-offline-nfs.conf.cmd | 33 ++++++++++++++++ 10 files changed, 167 insertions(+) create mode 100644 test/cfg2cmd/ide-required-iso-missing.conf create mode 100644 test/cfg2cmd/ide-required-iso-missing.conf.cmd create mode 100644 test/cfg2cmd/ide-required-iso-offline-nfs.conf create mode 100644 test/cfg2cmd/ide-required-iso-offline-nfs.conf.cmd create mode 100644 test/cfg2cmd/ide-required.conf create mode 100644 test/cfg2cmd/ide-required.conf.cmd create mode 100644 test/cfg2cmd/ide-unrequired-iso-missing.conf create mode 100644 test/cfg2cmd/ide-unrequired-iso-missing.conf.cmd create mode 100644 test/cfg2cmd/ide-unrequired-iso-offline-nfs.conf create mode 100644 test/cfg2cmd/ide-unrequired-iso-offline-nfs.conf.cmd diff --git a/test/cfg2cmd/ide-required-iso-missing.conf b/test/cfg2cmd/ide-required-iso-missing.conf new file mode 100644 index 00000000..16ce79ab --- /dev/null +++ b/test/cfg2cmd/ide-required-iso-missing.conf @@ -0,0 +1,12 @@ +# TEST: Config with default machine type, Linux & one IDE CD-ROM with online storage and missing required ISO file. +# EXPECT_ERROR: required file does not exist: 'ide0: cifs-store:iso/I_DO_NOT_EXIST.iso' +bootdisk: scsi0 +cores: 2 +ide0: cifs-store:iso/I_DO_NOT_EXIST.iso,media=cdrom,size=112M +memory: 512 +net0: virtio=2E:01:68:F9:9C:87,bridge=vmbr0 +ostype: l26 +scsi0: local:100/vm-100-disk-2.qcow2,size=10G +scsihw: virtio-scsi-pci +smbios1: uuid=3dd750ce-d910-44d0-9493-525c0be4e687 +vmgenid: 54d1c06c-8f5b-440f-b5b2-6eab1380e13d diff --git a/test/cfg2cmd/ide-required-iso-missing.conf.cmd b/test/cfg2cmd/ide-required-iso-missing.conf.cmd new file mode 100644 index 00000000..e69de29b diff --git a/test/cfg2cmd/ide-required-iso-offline-nfs.conf b/test/cfg2cmd/ide-required-iso-offline-nfs.conf new file mode 100644 index 00000000..47db264d --- /dev/null +++ b/test/cfg2cmd/ide-required-iso-offline-nfs.conf @@ -0,0 +1,12 @@ +# TEST: Config with default machine type, Linux & one IDE CD-ROM with required ISO file on offline storage. +# EXPECT_ERROR: cannot access required file: 'ide0: nfs-offline:iso/any.iso': storage 'nfs-offline' is not online +bootdisk: scsi0 +cores: 2 +ide0: nfs-offline:iso/any.iso,media=cdrom,size=112M +memory: 512 +net0: virtio=2E:01:68:F9:9C:87,bridge=vmbr0 +ostype: l26 +scsi0: local:100/vm-100-disk-2.qcow2,size=10G +scsihw: virtio-scsi-pci +smbios1: uuid=3dd750ce-d910-44d0-9493-525c0be4e687 +vmgenid: 54d1c06c-8f5b-440f-b5b2-6eab1380e13d diff --git a/test/cfg2cmd/ide-required-iso-offline-nfs.conf.cmd b/test/cfg2cmd/ide-required-iso-offline-nfs.conf.cmd new file mode 100644 index 00000000..e69de29b diff --git a/test/cfg2cmd/ide-required.conf b/test/cfg2cmd/ide-required.conf new file mode 100644 index 00000000..cf56b724 --- /dev/null +++ b/test/cfg2cmd/ide-required.conf @@ -0,0 +1,14 @@ +# TEST: Config with default machine type, Linux & four IDE CD-ROMs marked as required +bootdisk: scsi0 +cores: 2 +ide0: cifs-store:iso/zero.iso,media=cdrom,size=112M,required=1 +ide1: cifs-store:iso/one.iso,media=cdrom,size=112M,required=1 +ide2: cifs-store:iso/two.iso,media=cdrom,size=112M,required=1 +ide3: cifs-store:iso/three.iso,media=cdrom,size=112M,required=1 +memory: 512 +net0: virtio=2E:01:68:F9:9C:87,bridge=vmbr0 +ostype: l26 +scsi0: local:100/vm-100-disk-2.qcow2,size=10G +scsihw: virtio-scsi-pci +smbios1: uuid=3dd750ce-d910-44d0-9493-525c0be4e687 +vmgenid: 54d1c06c-8f5b-440f-b5b2-6eab1380e13d diff --git a/test/cfg2cmd/ide-required.conf.cmd b/test/cfg2cmd/ide-required.conf.cmd new file mode 100644 index 00000000..7fd4888c --- /dev/null +++ b/test/cfg2cmd/ide-required.conf.cmd @@ -0,0 +1,39 @@ +/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 \ + -smbios 'type=1,uuid=3dd750ce-d910-44d0-9493-525c0be4e687' \ + -smp '2,sockets=1,cores=2,maxcpus=2' \ + -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 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' \ + -device 'pci-bridge,id=pci.2,chassis_nr=2,bus=pci.0,addr=0x1f' \ + -device 'vmgenid,guid=54d1c06c-8f5b-440f-b5b2-6eab1380e13d' \ + -device 'piix3-usb-uhci,id=uhci,bus=pci.0,addr=0x1.0x2' \ + -device 'usb-tablet,id=tablet,bus=uhci.0,port=1' \ + -device 'VGA,id=vga,bus=pci.0,addr=0x2' \ + -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' \ + -drive 'file=/mnt/pve/cifs-store/template/iso/zero.iso,if=none,id=drive-ide0,media=cdrom,aio=threads' \ + -device 'ide-cd,bus=ide.0,unit=0,drive=drive-ide0,id=ide0,bootindex=200' \ + -drive 'file=/mnt/pve/cifs-store/template/iso/one.iso,if=none,id=drive-ide1,media=cdrom,aio=threads' \ + -device 'ide-cd,bus=ide.0,unit=1,drive=drive-ide1,id=ide1,bootindex=201' \ + -drive 'file=/mnt/pve/cifs-store/template/iso/two.iso,if=none,id=drive-ide2,media=cdrom,aio=threads' \ + -device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=202' \ + -drive 'file=/mnt/pve/cifs-store/template/iso/three.iso,if=none,id=drive-ide3,media=cdrom,aio=threads' \ + -device 'ide-cd,bus=ide.1,unit=1,drive=drive-ide3,id=ide3,bootindex=203' \ + -device 'virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5' \ + -drive 'file=/var/lib/vz/images/100/vm-100-disk-2.qcow2,if=none,id=drive-scsi0,format=qcow2,cache=none,aio=io_uring,detect-zeroes=on' \ + -device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,bootindex=100' \ + -netdev 'type=tap,id=net0,ifname=tap8006i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-server/pve-bridgedown,vhost=on' \ + -device 'virtio-net-pci,mac=2E:01:68:F9:9C:87,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \ + -machine 'type=pc+pve0' diff --git a/test/cfg2cmd/ide-unrequired-iso-missing.conf b/test/cfg2cmd/ide-unrequired-iso-missing.conf new file mode 100644 index 00000000..d4393772 --- /dev/null +++ b/test/cfg2cmd/ide-unrequired-iso-missing.conf @@ -0,0 +1,12 @@ +# TEST: Config with default machine type, Linux & and one IDE CD-ROM with online storage and missing unrequired ISO file. +# EXPECT_WARN: eject 'ide0: cifs-store:iso/I_DO_NOT_EXIST.iso': file does not exist +bootdisk: scsi0 +cores: 2 +ide0: cifs-store:iso/I_DO_NOT_EXIST.iso,media=cdrom,size=112M,required=0 +memory: 512 +net0: virtio=2E:01:68:F9:9C:87,bridge=vmbr0 +ostype: l26 +scsi0: local:100/vm-100-disk-2.qcow2,size=10G +scsihw: virtio-scsi-pci +smbios1: uuid=3dd750ce-d910-44d0-9493-525c0be4e687 +vmgenid: 54d1c06c-8f5b-440f-b5b2-6eab1380e13d diff --git a/test/cfg2cmd/ide-unrequired-iso-missing.conf.cmd b/test/cfg2cmd/ide-unrequired-iso-missing.conf.cmd new file mode 100644 index 00000000..e6efd8a9 --- /dev/null +++ b/test/cfg2cmd/ide-unrequired-iso-missing.conf.cmd @@ -0,0 +1,33 @@ +/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 \ + -smbios 'type=1,uuid=3dd750ce-d910-44d0-9493-525c0be4e687' \ + -smp '2,sockets=1,cores=2,maxcpus=2' \ + -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 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' \ + -device 'pci-bridge,id=pci.2,chassis_nr=2,bus=pci.0,addr=0x1f' \ + -device 'vmgenid,guid=54d1c06c-8f5b-440f-b5b2-6eab1380e13d' \ + -device 'piix3-usb-uhci,id=uhci,bus=pci.0,addr=0x1.0x2' \ + -device 'usb-tablet,id=tablet,bus=uhci.0,port=1' \ + -device 'VGA,id=vga,bus=pci.0,addr=0x2' \ + -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' \ + -drive 'if=none,id=drive-ide0,media=cdrom,aio=io_uring' \ + -device 'ide-cd,bus=ide.0,unit=0,drive=drive-ide0,id=ide0,bootindex=200' \ + -device 'virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5' \ + -drive 'file=/var/lib/vz/images/100/vm-100-disk-2.qcow2,if=none,id=drive-scsi0,format=qcow2,cache=none,aio=io_uring,detect-zeroes=on' \ + -device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,bootindex=100' \ + -netdev 'type=tap,id=net0,ifname=tap8006i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-server/pve-bridgedown,vhost=on' \ + -device 'virtio-net-pci,mac=2E:01:68:F9:9C:87,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \ + -machine 'type=pc+pve0' diff --git a/test/cfg2cmd/ide-unrequired-iso-offline-nfs.conf b/test/cfg2cmd/ide-unrequired-iso-offline-nfs.conf new file mode 100644 index 00000000..c7a59d0d --- /dev/null +++ b/test/cfg2cmd/ide-unrequired-iso-offline-nfs.conf @@ -0,0 +1,12 @@ +# TEST: Config with default machine type, Linux & and one IDE CD-ROM with unrequired ISO file on offline storage. +# EXPECT_WARN: eject 'ide0: nfs-offline:iso/any.iso': storage 'nfs-offline' is not online +bootdisk: scsi0 +cores: 2 +ide0: nfs-offline:iso/any.iso,media=cdrom,size=112M,required=0 +memory: 512 +net0: virtio=2E:01:68:F9:9C:87,bridge=vmbr0 +ostype: l26 +scsi0: local:100/vm-100-disk-2.qcow2,size=10G +scsihw: virtio-scsi-pci +smbios1: uuid=3dd750ce-d910-44d0-9493-525c0be4e687 +vmgenid: 54d1c06c-8f5b-440f-b5b2-6eab1380e13d diff --git a/test/cfg2cmd/ide-unrequired-iso-offline-nfs.conf.cmd b/test/cfg2cmd/ide-unrequired-iso-offline-nfs.conf.cmd new file mode 100644 index 00000000..e6efd8a9 --- /dev/null +++ b/test/cfg2cmd/ide-unrequired-iso-offline-nfs.conf.cmd @@ -0,0 +1,33 @@ +/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 \ + -smbios 'type=1,uuid=3dd750ce-d910-44d0-9493-525c0be4e687' \ + -smp '2,sockets=1,cores=2,maxcpus=2' \ + -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 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' \ + -device 'pci-bridge,id=pci.2,chassis_nr=2,bus=pci.0,addr=0x1f' \ + -device 'vmgenid,guid=54d1c06c-8f5b-440f-b5b2-6eab1380e13d' \ + -device 'piix3-usb-uhci,id=uhci,bus=pci.0,addr=0x1.0x2' \ + -device 'usb-tablet,id=tablet,bus=uhci.0,port=1' \ + -device 'VGA,id=vga,bus=pci.0,addr=0x2' \ + -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' \ + -drive 'if=none,id=drive-ide0,media=cdrom,aio=io_uring' \ + -device 'ide-cd,bus=ide.0,unit=0,drive=drive-ide0,id=ide0,bootindex=200' \ + -device 'virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5' \ + -drive 'file=/var/lib/vz/images/100/vm-100-disk-2.qcow2,if=none,id=drive-scsi0,format=qcow2,cache=none,aio=io_uring,detect-zeroes=on' \ + -device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,bootindex=100' \ + -netdev 'type=tap,id=net0,ifname=tap8006i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-server/pve-bridgedown,vhost=on' \ + -device 'virtio-net-pci,mac=2E:01:68:F9:9C:87,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256,bootindex=300' \ + -machine 'type=pc+pve0' -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel