From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <d.csapak@proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id 89A658B7A3
 for <pve-devel@lists.proxmox.com>; Mon, 24 Oct 2022 16:21:13 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id 63DBB1A3B1
 for <pve-devel@lists.proxmox.com>; Mon, 24 Oct 2022 16:20:43 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com
 [94.136.29.106])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by firstgate.proxmox.com (Proxmox) with ESMTPS
 for <pve-devel@lists.proxmox.com>; Mon, 24 Oct 2022 16:20:41 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
 by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 5AB2844A87;
 Mon, 24 Oct 2022 16:20:41 +0200 (CEST)
Message-ID: <07bd4079-a20e-4d53-b91d-624cbbfe888a@proxmox.com>
Date: Mon, 24 Oct 2022 16:20:39 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:107.0) Gecko/20100101
 Thunderbird/107.0
Content-Language: en-US
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
 Markus Frank <m.frank@proxmox.com>
References: <20220921090748.47445-1-m.frank@proxmox.com>
 <20220921090748.47445-4-m.frank@proxmox.com>
From: Dominik Csapak <d.csapak@proxmox.com>
In-Reply-To: <20220921090748.47445-4-m.frank@proxmox.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.067 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 NICE_REPLY_A           -0.001 Looks like a legit reply (A)
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
Subject: Re: [pve-devel] [PATCH qemu-server 3/3] added test-cases for new
 machine-syntax & viommu
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Mon, 24 Oct 2022 14:21:13 -0000

On 9/21/22 11:07, Markus Frank wrote:
> added a few test-cases to test the new machine parameter with viommu
> 
> Signed-off-by: Markus Frank <m.frank@proxmox.com>
> ---
>   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                         |  8 ++-
>   10 files changed, 196 insertions(+), 2 deletions(-)
>   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/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 3f1ac7c..3fcb0eb 100644
> --- a/test/snapshot-test.pm
> +++ b/test/snapshot-test.pm
> @@ -305,7 +305,7 @@ sub __snapshot_save_vmstate {
>   
>       my $snap = $conf->{snapshots}->{$snapname};
>       $snap->{vmstate} = "somestorage:state-volume";
> -    $snap->{runningmachine} = "somemachine"
> +    $snap->{runningmachine} = "q35"
>   }

i guess this change belongs to the first patch ? (since those tests
fail without this)

>   
>   sub assert_config_exists_on_node {
> @@ -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");