qemu-server/test/cfg2cmd
Dominik Csapak 57db7085b8 machine: bump pve machine version and reverse the s3/s4 defaults
So new guests, or guests with the 'latest' machine type, have that
setting automatically disabled.

The previous default (enabling S3/S4), does not make too much sense in
a virtual environment, and sometimes makes problems, e.g. Windows
defaults to using 'hybrid shutdown' and 'fast startup' when S4 is
enabled, which leads to NVIDIA vGPU being broken on the boot after
that.

Since the tests don't pin the pve version themselves, we have to
update all the ones where the machine versions are derived from the
installed QEMU version.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Tested-By: Stoiko Ivanov <s.ivanov@proxmox.com>
Link: https://lore.proxmox.com/20250404125345.3244659-7-d.csapak@proxmox.com
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-04-06 19:08:31 +02:00
..
bootorder-empty.conf test: cfg2cmd: don't use QEMU binary version less than 6.0 for tests 2024-12-05 12:13:20 +01:00
bootorder-empty.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
bootorder-legacy.conf test: cfg2cmd: don't use QEMU binary version less than 6.0 for tests 2024-12-05 12:13:20 +01:00
bootorder-legacy.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
bootorder.conf test: cfg2cmd: don't use QEMU binary version less than 6.0 for tests 2024-12-05 12:13:20 +01:00
bootorder.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
cputype-icelake-client-deprecation.conf cfg2cmd tests: various typo fixes 2024-12-05 12:20:54 +01:00
cputype-icelake-client-deprecation.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
custom-cpu-model-defaults.conf cfg2cmd: add test cases for custom CPU models 2020-04-07 17:27:58 +02:00
custom-cpu-model-defaults.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
custom-cpu-model-host-phys-bits.conf tests: cfg2cmd: check also warnings 2020-08-21 10:38:27 +02:00
custom-cpu-model-host-phys-bits.conf.cmd config to command: get rid of globalFlags 2025-04-06 19:08:31 +02:00
custom-cpu-model.conf tests: cfg2cmd: check also warnings 2020-08-21 10:38:27 +02:00
custom-cpu-model.conf.cmd config to command: get rid of globalFlags 2025-04-06 19:08:31 +02:00
efi-raw-old.conf fix efidisks on storages with minimum sizes bigger than OVMF_VARS.fd 2020-03-30 09:41:55 +02:00
efi-raw-old.conf.cmd ovmf cmd assembly: reorder arguments 2022-12-12 11:41:50 +01:00
efi-raw-template.conf test: add template drive read-only tests 2021-06-23 12:37:40 +02:00
efi-raw-template.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
efi-raw.conf fix efidisks on storages with minimum sizes bigger than OVMF_VARS.fd 2020-03-30 09:41:55 +02:00
efi-raw.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
efi-secboot-and-tpm-q35.conf use non SMM ovmf code file for i440fx machines 2021-10-21 12:38:58 +02:00
efi-secboot-and-tpm-q35.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
efi-secboot-and-tpm.conf use non SMM ovmf code file for i440fx machines 2021-10-21 12:38:58 +02:00
efi-secboot-and-tpm.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
efidisk-on-rbd.conf cfg2cmd: add test for efidisk rbd cache handling 2021-06-16 15:24:57 +02:00
efidisk-on-rbd.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
i440fx-viommu-intel.conf fix #3784: config: Parameter for guest vIOMMU + test-cases 2024-04-11 16:40:17 +02:00
i440fx-viommu-virtio.conf fix #3784: config: Parameter for guest vIOMMU + test-cases 2024-04-11 16:40:17 +02:00
i440fx-viommu-virtio.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
i440fx-win10-hostpci.conf cfg2cmd: fix descriptions of cfg2cmd test cases 2019-10-02 08:35:27 +02:00
i440fx-win10-hostpci.conf.cmd config to command: get rid of globalFlags 2025-04-06 19:08:31 +02:00
ide-no-media-error.conf print drive commandline: die if drive with ISO sets no explicit media 2025-04-04 15:41:54 +02:00
ide.conf test: add tests with multiple IDE CD-ROM drives 2023-07-20 12:20:25 +02:00
ide.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
memory-hotplug-hugepages.conf test: cfg2cmd: don't use QEMU binary version less than 4.0 for tests 2024-12-05 12:13:20 +01:00
memory-hotplug-hugepages.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
memory-hotplug.conf test: cfg2cmd: don't use QEMU binary version less than 4.0 for tests 2024-12-05 12:13:20 +01:00
memory-hotplug.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
memory-hugepages-1g.conf cfg2cmd tests: various typo fixes 2024-12-05 12:20:54 +01:00
memory-hugepages-1g.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
memory-hugepages-2m.conf cfg2cmd tests: various typo fixes 2024-12-05 12:20:54 +01:00
memory-hugepages-2m.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
minimal-defaults-to-new-machine.conf cfg2cmd tests: various typo fixes 2024-12-05 12:20:54 +01:00
minimal-defaults-unsupported-pve-version.conf cfg2cmd tests: various typo fixes 2024-12-05 12:20:54 +01:00
minimal-defaults.conf add config to command tests 2018-12-11 10:44:04 +01:00
minimal-defaults.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
netdev-7.0-multiqueues.conf test: cfg2cmd: don't use QEMU binary version less than 8.0 for tests 2024-12-05 12:13:20 +01:00
netdev-7.0-multiqueues.conf.cmd test: cfg2cmd: don't use QEMU binary version less than 8.0 for tests 2024-12-05 12:13:20 +01:00
netdev-7.1-multiqueues.conf test: cfg2cmd: don't use QEMU binary version less than 8.0 for tests 2024-12-05 12:13:20 +01:00
netdev-7.1-multiqueues.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
netdev-7.1.conf test: cfg2cmd: don't use QEMU binary version less than 8.0 for tests 2024-12-05 12:13:20 +01:00
netdev-7.1.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
netdev.conf test: cfg2cmd: don't use QEMU binary version less than 6.0 for tests 2024-12-05 12:13:20 +01:00
netdev.conf.cmd test: cfg2cmd: don't use QEMU binary version less than 6.0 for tests 2024-12-05 12:13:20 +01:00
old-qemu.conf cfg2cmd: require at least QEMU binary version 5.0 2024-12-05 12:13:20 +01:00
ostype-usb13-error.conf test: cfg2cmd: don't use QEMU binary version less than 8.0 for tests 2024-12-05 12:13:20 +01:00
pinned-version-pxe-pve.conf cfg2cmd: fix +pveN machine types with pxe 2021-04-18 17:58:56 +02:00
pinned-version-pxe-pve.conf.cmd fix #4115: enable option to name QEMU threads after their main purpose 2022-06-17 14:25:49 +02:00
pinned-version-pxe.conf cfg2cmd: fix +pveN machine types with pxe 2021-04-18 17:58:56 +02:00
pinned-version-pxe.conf.cmd fix #4115: enable option to name QEMU threads after their main purpose 2022-06-17 14:25:49 +02:00
pinned-version.conf refactor: split qemu_machine_feature_enabled 2019-11-20 18:32:35 +01:00
pinned-version.conf.cmd fix #4115: enable option to name QEMU threads after their main purpose 2022-06-17 14:25:49 +02:00
q35-ide.conf test: add tests with multiple IDE CD-ROM drives 2023-07-20 12:20:25 +02:00
q35-ide.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
q35-linux-hostpci-mapping.conf add test for mapped pci devices 2023-06-19 07:21:49 +02:00
q35-linux-hostpci-mapping.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
q35-linux-hostpci-multifunction.conf cfg2cmd test: add tests for multifunction devices 2019-12-09 11:30:14 +01:00
q35-linux-hostpci-multifunction.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
q35-linux-hostpci-template.conf tests: cfg2cmd: add test for templates with more options 2024-07-01 10:48:27 +02:00
q35-linux-hostpci-template.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
q35-linux-hostpci-x-pci-overrides.conf pci: allow override of PCI vendor/device ids 2022-01-25 10:59:23 +01:00
q35-linux-hostpci-x-pci-overrides.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
q35-linux-hostpci.conf enable cluster mapped PCI devices for guests 2023-06-16 16:24:02 +02:00
q35-linux-hostpci.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
q35-simple-6.0.conf test: cfg2cmd: don't use QEMU binary version less than 7.0 for tests 2024-12-05 12:13:20 +01:00
q35-simple-6.0.conf.cmd test: cfg2cmd: don't use QEMU binary version less than 7.0 for tests 2024-12-05 12:13:20 +01:00
q35-simple-7.0.conf test: cfg2cmd: don't use QEMU binary version less than 8.0 for tests 2024-12-05 12:13:20 +01:00
q35-simple-7.0.conf.cmd test: cfg2cmd: don't use QEMU binary version less than 8.0 for tests 2024-12-05 12:13:20 +01:00
q35-simple-pinned-6.1.conf tests: cfg2cmd: add a few q35 related tests 2021-11-04 15:30:30 +01:00
q35-simple-pinned-6.1.conf.cmd ovmf cmd assembly: reorder arguments 2022-12-12 11:41:50 +01:00
q35-simple.conf tests: cfg2cmd: add a few q35 related tests 2021-11-04 15:30:30 +01:00
q35-simple.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
q35-usb2.conf test: cfg2cmd: don't use QEMU binary version less than 5.0 for tests 2024-12-05 12:13:20 +01:00
q35-usb2.conf.cmd test: cfg2cmd: don't use QEMU binary version less than 5.0 for tests 2024-12-05 12:13:20 +01:00
q35-usb3.conf test: cfg2cmd: don't use QEMU binary version less than 5.0 for tests 2024-12-05 12:13:20 +01:00
q35-usb3.conf.cmd test: cfg2cmd: don't use QEMU binary version less than 5.0 for tests 2024-12-05 12:13:20 +01:00
q35-usb13-error.conf test: cfg2cmd: don't use QEMU binary version less than 5.0 for tests 2024-12-05 12:13:20 +01:00
q35-viommu-intel.conf fix #3784: config: Parameter for guest vIOMMU + test-cases 2024-04-11 16:40:17 +02:00
q35-viommu-intel.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
q35-viommu-virtio.conf fix #3784: config: Parameter for guest vIOMMU + test-cases 2024-04-11 16:40:17 +02:00
q35-viommu-virtio.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
q35-win10-hostpci.conf cfg2cmd test: hostpci, also specify exact PCIe devices 2019-09-09 08:40:07 +02:00
q35-win10-hostpci.conf.cmd config to command: get rid of globalFlags 2025-04-06 19:08:31 +02:00
q35-windows-pinning.conf tests: cfg2cmd: add test for windows machine pinning from meta info 2025-04-06 19:08:31 +02:00
q35-windows-pinning.conf.cmd config to command: get rid of globalFlags 2025-04-06 19:08:31 +02:00
qemu-xhci-7.1.conf test: cfg2cmd: don't use QEMU binary version less than 8.0 for tests 2024-12-05 12:13:20 +01:00
qemu-xhci-7.1.conf.cmd test: cfg2cmd: don't use QEMU binary version less than 8.0 for tests 2024-12-05 12:13:20 +01:00
qemu-xhci-q35-7.1.conf test: cfg2cmd: don't use QEMU binary version less than 8.0 for tests 2024-12-05 12:13:20 +01:00
qemu-xhci-q35-7.1.conf.cmd cfg2cmd: netdev: fix value for tx_queue_size 2023-07-27 13:14:12 +02:00
README.adoc add config to command tests 2018-12-11 10:44:04 +01:00
seabios_serial.conf cfg2cmd: turn smm off when SeaBIOS and serial display are used 2021-11-11 10:32:17 +01:00
seabios_serial.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
sev-es.conf tests: cfg2cmd: add very basic SEV tests 2025-04-03 21:44:15 +02:00
sev-es.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
sev-snp.conf tests: cfg2cmd: add very basic SEV tests 2025-04-03 21:44:15 +02:00
sev-snp.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
sev-std.conf tests: cfg2cmd: add very basic SEV tests 2025-04-03 21:44:15 +02:00
sev-std.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
simple1-template.conf test: cfg2cmd: don't use QEMU binary version less than 4.0 for tests 2024-12-05 12:13:20 +01:00
simple1-template.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
simple1.conf test: cfg2cmd: don't use QEMU binary version less than 4.0 for tests 2024-12-05 12:13:20 +01:00
simple1.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
simple-balloon-free-page-reporting.conf test: cfg2cmd: don't use QEMU binary version less than 7.0 for tests 2024-12-05 12:13:20 +01:00
simple-balloon-free-page-reporting.conf.cmd test: cfg2cmd: don't use QEMU binary version less than 7.0 for tests 2024-12-05 12:13:20 +01:00
simple-btrfs.conf test: cfg2cmd: don't use QEMU binary version less than 7.0 for tests 2024-12-05 12:13:20 +01:00
simple-btrfs.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
simple-virtio-blk.conf test: cfg2cmd: don't use QEMU binary version less than 6.0 for tests 2024-12-05 12:13:20 +01:00
simple-virtio-blk.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
spice-enhancments.conf test: cfg2cmd: don't use QEMU binary version less than 5.0 for tests 2024-12-05 12:13:20 +01:00
spice-enhancments.conf.cmd test: cfg2cmd: don't use QEMU binary version less than 5.0 for tests 2024-12-05 12:13:20 +01:00
spice-linux-4.1.conf test: cfg2cmd: don't use QEMU binary version less than 5.0 for tests 2024-12-05 12:13:20 +01:00
spice-linux-4.1.conf.cmd test: cfg2cmd: don't use QEMU binary version less than 5.0 for tests 2024-12-05 12:13:20 +01:00
spice-usb3.conf test: cfg2cmd: don't use QEMU binary version less than 5.0 for tests 2024-12-05 12:13:20 +01:00
spice-usb3.conf.cmd test: cfg2cmd: don't use QEMU binary version less than 5.0 for tests 2024-12-05 12:13:20 +01:00
spice-win.conf test: cfg2cmd: don't use QEMU binary version less than 5.0 for tests 2024-12-05 12:13:20 +01:00
spice-win.conf.cmd config to command: get rid of globalFlags 2025-04-06 19:08:31 +02:00
unsupported-storage-content-type.conf test: cfg2cmd: expect error for invalid volume's storage content type 2025-02-20 14:35:30 +01:00
usb13-error.conf test: cfg2cmd: don't use QEMU binary version less than 5.0 for tests 2024-12-05 12:13:20 +01:00
vnc-clipboard-spice.conf tests: cfg2cmd: rename vnc-clipboard to lower-case and add description 2023-11-20 16:36:51 +01:00
vnc-clipboard-spice.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
vnc-clipboard-std.conf tests: cfg2cmd: rename vnc-clipboard to lower-case and add description 2023-11-20 16:36:51 +01:00
vnc-clipboard-std.conf.cmd machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00

QemuServer Config 2 Command Test
================================
Thomas Lamprecht <t.lamprecht@proxmox.com>

Overview
--------

This is a relatively simple configuration to command test program.
It's main goals are to better enforce stability of commands, thus reducing
the likelihood that, for example, a migration breaking change which forgot to
bump/check the KVM/QEMU version, slips through

Further you get a certain regression and functional test coverage. You get a
safety net against breaking older or not often (manual) tested setups and
features.

NOTE: The safety net is only as good as the test count *and* quality.


Test Specification
------------------

A single test consists of two files, the input VM config `FILE.conf` and the
expected output command `FILE.conf.cmd`

Input
~~~~~

The `FILE.conf` are standard Proxmox VE VM configuration files, so you can just
copy over a config file from `/etc/pve/qemu-server` to add a configuration you
want to have tested.

Output
~~~~~~

For the expected output `FILE.conf.cmd` we check the KVM/QEMU command produced.
As a single long line would be pretty hard to check for (problematic) changes
by humans, we use a pretty format, i.e., where each key value pair is on it's
own line. With this approach we can just diff expected and actual command and
one can pin point pretty fast in which component (e.g., net, drives, CPU, ...)
the issue is, if any. Such an output would look like:

----
/usr/bin/kvm \
  -id 101 \
  -name vm101 \
  ...
----

TIP: If the expected output file does not exist we have nothing to check, but
for convenience we will write it out. This should happen from clean code, and
the result should not get applied blindly, but only after a (quick) sanity
check.


Environment
~~~~~~~~~~~

It makes sense to have a stable and controlled environment for tests, thus you
one can use the 'description' in VM configurations to control this. The
description consists of all lines beginning with a '#' as first non-whitespace
character. Any environment variable follows the following format:

----
# NAME: VALUE
... rest of config...
----

There are the following variables you can control:

* *TEST*: a one line description for your test, gets outputted one testing and
  should described in a short way any specialty about this specific test,
  i.e., what does this test wants to ensure.

* *QEMU_VERSION*: the version we fake for this test, if not set we use the
  actual one installed on the host.

* *HOST_ARCH*: the architecture we should fake for the test (aarch64 or x86_64),
  defaults to `x86_64` to allow making this optional and still guarantee
  stable tests

The storage environment is currently hardcoded in the test code, you can
extend it there if it's needed.

// vim: noai:tw=78