Currently support 'def parse', 'def -> XML' and 'OUT -> XML'. Test data for qemucapabilitiestest, domaincapstest and qemuxml2argvtest aren't added yet because that depends on TDX is accepted on QEMU side to generate those data. Signed-off-by: Zhenzhong Duan <zhenzhong.duan@xxxxxxxxx> --- ...unch-security-tdx-qgs-fd.x86_64-latest.xml | 77 +++++++++++++++++++ .../launch-security-tdx-qgs-fd.xml | 30 ++++++++ ...ch-security-tdx-qgs-inet.x86_64-latest.xml | 77 +++++++++++++++++++ .../launch-security-tdx-qgs-inet.xml | 30 ++++++++ ...ch-security-tdx-qgs-unix.x86_64-latest.xml | 77 +++++++++++++++++++ .../launch-security-tdx-qgs-unix.xml | 30 ++++++++ ...h-security-tdx-qgs-vsock.x86_64-latest.xml | 77 +++++++++++++++++++ .../launch-security-tdx-qgs-vsock.xml | 30 ++++++++ tests/qemuxmlconftest.c | 24 ++++++ 9 files changed, 452 insertions(+) create mode 100644 tests/qemuxmlconfdata/launch-security-tdx-qgs-fd.x86_64-latest.xml create mode 100644 tests/qemuxmlconfdata/launch-security-tdx-qgs-fd.xml create mode 100644 tests/qemuxmlconfdata/launch-security-tdx-qgs-inet.x86_64-latest.xml create mode 100644 tests/qemuxmlconfdata/launch-security-tdx-qgs-inet.xml create mode 100644 tests/qemuxmlconfdata/launch-security-tdx-qgs-unix.x86_64-latest.xml create mode 100644 tests/qemuxmlconfdata/launch-security-tdx-qgs-unix.xml create mode 100644 tests/qemuxmlconfdata/launch-security-tdx-qgs-vsock.x86_64-latest.xml create mode 100644 tests/qemuxmlconfdata/launch-security-tdx-qgs-vsock.xml diff --git a/tests/qemuxmlconfdata/launch-security-tdx-qgs-fd.x86_64-latest.xml b/tests/qemuxmlconfdata/launch-security-tdx-qgs-fd.x86_64-latest.xml new file mode 100644 index 0000000000..952615082e --- /dev/null +++ b/tests/qemuxmlconfdata/launch-security-tdx-qgs-fd.x86_64-latest.xml @@ -0,0 +1,77 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory unit='KiB'>4194304</memory> + <currentMemory unit='KiB'>4194304</currentMemory> + <vcpu placement='static'>4</vcpu> + <os> + <type arch='x86_64' machine='q35'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu64</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='usb' index='0' model='piix3-uhci'> + <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/> + </controller> + <controller type='scsi' index='0' model='lsilogic'> + <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/> + </controller> + <controller type='sata' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pcie-root'/> + <controller type='pci' index='1' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='1' port='0x10'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/> + </controller> + <controller type='pci' index='2' model='pcie-to-pci-bridge'> + <model name='pcie-pci-bridge'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </controller> + <controller type='pci' index='3' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='3' port='0x11'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/> + </controller> + <interface type='user'> + <mac address='52:54:00:09:a4:37'/> + <model type='rtl8139'/> + <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/> + </interface> + <serial type='pty'> + <target type='isa-serial' port='0'> + <model name='isa-serial'/> + </target> + </serial> + <console type='pty'> + <target type='serial' port='0'/> + </console> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <audio id='1' type='none'/> + <video> + <model type='cirrus' vram='16384' heads='1' primary='yes'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </video> + <watchdog model='itco' action='reset'/> + <memballoon model='none'/> + <panic model='isa'/> + </devices> + <launchSecurity type='tdx'> + <policy>0x1</policy> + <mrConfigId>xxx</mrConfigId> + <mrOwner>xxx</mrOwner> + <mrOwnerConfig>xxx</mrOwnerConfig> + <quoteGenerationService> + <SocketAddress type='fd' str='xxx'/> + </quoteGenerationService> + </launchSecurity> +</domain> diff --git a/tests/qemuxmlconfdata/launch-security-tdx-qgs-fd.xml b/tests/qemuxmlconfdata/launch-security-tdx-qgs-fd.xml new file mode 100644 index 0000000000..60e3e5b8a7 --- /dev/null +++ b/tests/qemuxmlconfdata/launch-security-tdx-qgs-fd.xml @@ -0,0 +1,30 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory>4194304</memory> + <vcpu>4</vcpu> + <os> + <type arch='x86_64' machine='q35'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='usb'/> + <controller type='scsi'/> + <interface type='user'> + <mac address='52:54:00:09:a4:37'/> + </interface> + <serial type='pty'/> + <video/> + <memballoon model='none'/> + <panic/> + </devices> + <launchSecurity type='tdx'> + <policy>0x1</policy> + <mrConfigId>xxx</mrConfigId> + <mrOwner>xxx</mrOwner> + <mrOwnerConfig>xxx</mrOwnerConfig> + <quoteGenerationService> + <SocketAddress type='fd' str='xxx'/> + </quoteGenerationService> + </launchSecurity> +</domain> diff --git a/tests/qemuxmlconfdata/launch-security-tdx-qgs-inet.x86_64-latest.xml b/tests/qemuxmlconfdata/launch-security-tdx-qgs-inet.x86_64-latest.xml new file mode 100644 index 0000000000..860b47f306 --- /dev/null +++ b/tests/qemuxmlconfdata/launch-security-tdx-qgs-inet.x86_64-latest.xml @@ -0,0 +1,77 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory unit='KiB'>4194304</memory> + <currentMemory unit='KiB'>4194304</currentMemory> + <vcpu placement='static'>4</vcpu> + <os> + <type arch='x86_64' machine='q35'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu64</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='usb' index='0' model='piix3-uhci'> + <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/> + </controller> + <controller type='scsi' index='0' model='lsilogic'> + <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/> + </controller> + <controller type='sata' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pcie-root'/> + <controller type='pci' index='1' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='1' port='0x10'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/> + </controller> + <controller type='pci' index='2' model='pcie-to-pci-bridge'> + <model name='pcie-pci-bridge'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </controller> + <controller type='pci' index='3' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='3' port='0x11'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/> + </controller> + <interface type='user'> + <mac address='52:54:00:09:a4:37'/> + <model type='rtl8139'/> + <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/> + </interface> + <serial type='pty'> + <target type='isa-serial' port='0'> + <model name='isa-serial'/> + </target> + </serial> + <console type='pty'> + <target type='serial' port='0'/> + </console> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <audio id='1' type='none'/> + <video> + <model type='cirrus' vram='16384' heads='1' primary='yes'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </video> + <watchdog model='itco' action='reset'/> + <memballoon model='none'/> + <panic model='isa'/> + </devices> + <launchSecurity type='tdx'> + <policy>0x1</policy> + <mrConfigId>xxx</mrConfigId> + <mrOwner>xxx</mrOwner> + <mrOwnerConfig>xxx</mrOwnerConfig> + <quoteGenerationService> + <SocketAddress type='inet' host='xxx' port='xxx' numeric='yes' to='1' ipv4='yes' ipv6='no' keep_alive='yes' mptcp='yes'/> + </quoteGenerationService> + </launchSecurity> +</domain> diff --git a/tests/qemuxmlconfdata/launch-security-tdx-qgs-inet.xml b/tests/qemuxmlconfdata/launch-security-tdx-qgs-inet.xml new file mode 100644 index 0000000000..eb6f53baf9 --- /dev/null +++ b/tests/qemuxmlconfdata/launch-security-tdx-qgs-inet.xml @@ -0,0 +1,30 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory>4194304</memory> + <vcpu>4</vcpu> + <os> + <type arch='x86_64' machine='q35'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='usb'/> + <controller type='scsi'/> + <interface type='user'> + <mac address='52:54:00:09:a4:37'/> + </interface> + <serial type='pty'/> + <video/> + <memballoon model='none'/> + <panic/> + </devices> + <launchSecurity type='tdx'> + <policy>0x1</policy> + <mrConfigId>xxx</mrConfigId> + <mrOwner>xxx</mrOwner> + <mrOwnerConfig>xxx</mrOwnerConfig> + <quoteGenerationService> + <SocketAddress type='inet' host='xxx' port='xxx' numeric='yes' to='1' ipv4='yes' ipv6='no' keep_alive='yes' mptcp='yes'/> + </quoteGenerationService> + </launchSecurity> +</domain> diff --git a/tests/qemuxmlconfdata/launch-security-tdx-qgs-unix.x86_64-latest.xml b/tests/qemuxmlconfdata/launch-security-tdx-qgs-unix.x86_64-latest.xml new file mode 100644 index 0000000000..b18910b1d5 --- /dev/null +++ b/tests/qemuxmlconfdata/launch-security-tdx-qgs-unix.x86_64-latest.xml @@ -0,0 +1,77 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory unit='KiB'>4194304</memory> + <currentMemory unit='KiB'>4194304</currentMemory> + <vcpu placement='static'>4</vcpu> + <os> + <type arch='x86_64' machine='q35'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu64</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='usb' index='0' model='piix3-uhci'> + <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/> + </controller> + <controller type='scsi' index='0' model='lsilogic'> + <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/> + </controller> + <controller type='sata' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pcie-root'/> + <controller type='pci' index='1' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='1' port='0x10'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/> + </controller> + <controller type='pci' index='2' model='pcie-to-pci-bridge'> + <model name='pcie-pci-bridge'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </controller> + <controller type='pci' index='3' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='3' port='0x11'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/> + </controller> + <interface type='user'> + <mac address='52:54:00:09:a4:37'/> + <model type='rtl8139'/> + <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/> + </interface> + <serial type='pty'> + <target type='isa-serial' port='0'> + <model name='isa-serial'/> + </target> + </serial> + <console type='pty'> + <target type='serial' port='0'/> + </console> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <audio id='1' type='none'/> + <video> + <model type='cirrus' vram='16384' heads='1' primary='yes'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </video> + <watchdog model='itco' action='reset'/> + <memballoon model='none'/> + <panic model='isa'/> + </devices> + <launchSecurity type='tdx'> + <policy>0x1</policy> + <mrConfigId>xxx</mrConfigId> + <mrOwner>xxx</mrOwner> + <mrOwnerConfig>xxx</mrOwnerConfig> + <quoteGenerationService> + <SocketAddress type='unix' path='xxx' abstract='yes' tight='yes'/> + </quoteGenerationService> + </launchSecurity> +</domain> diff --git a/tests/qemuxmlconfdata/launch-security-tdx-qgs-unix.xml b/tests/qemuxmlconfdata/launch-security-tdx-qgs-unix.xml new file mode 100644 index 0000000000..daeee80939 --- /dev/null +++ b/tests/qemuxmlconfdata/launch-security-tdx-qgs-unix.xml @@ -0,0 +1,30 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory>4194304</memory> + <vcpu>4</vcpu> + <os> + <type arch='x86_64' machine='q35'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='usb'/> + <controller type='scsi'/> + <interface type='user'> + <mac address='52:54:00:09:a4:37'/> + </interface> + <serial type='pty'/> + <video/> + <memballoon model='none'/> + <panic/> + </devices> + <launchSecurity type='tdx'> + <policy>0x1</policy> + <mrConfigId>xxx</mrConfigId> + <mrOwner>xxx</mrOwner> + <mrOwnerConfig>xxx</mrOwnerConfig> + <quoteGenerationService> + <SocketAddress type='unix' path='xxx' abstract='yes' tight='yes'/> + </quoteGenerationService> + </launchSecurity> +</domain> diff --git a/tests/qemuxmlconfdata/launch-security-tdx-qgs-vsock.x86_64-latest.xml b/tests/qemuxmlconfdata/launch-security-tdx-qgs-vsock.x86_64-latest.xml new file mode 100644 index 0000000000..dfc0b744d8 --- /dev/null +++ b/tests/qemuxmlconfdata/launch-security-tdx-qgs-vsock.x86_64-latest.xml @@ -0,0 +1,77 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory unit='KiB'>4194304</memory> + <currentMemory unit='KiB'>4194304</currentMemory> + <vcpu placement='static'>4</vcpu> + <os> + <type arch='x86_64' machine='q35'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu64</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='usb' index='0' model='piix3-uhci'> + <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/> + </controller> + <controller type='scsi' index='0' model='lsilogic'> + <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/> + </controller> + <controller type='sata' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pcie-root'/> + <controller type='pci' index='1' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='1' port='0x10'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/> + </controller> + <controller type='pci' index='2' model='pcie-to-pci-bridge'> + <model name='pcie-pci-bridge'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </controller> + <controller type='pci' index='3' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='3' port='0x11'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/> + </controller> + <interface type='user'> + <mac address='52:54:00:09:a4:37'/> + <model type='rtl8139'/> + <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/> + </interface> + <serial type='pty'> + <target type='isa-serial' port='0'> + <model name='isa-serial'/> + </target> + </serial> + <console type='pty'> + <target type='serial' port='0'/> + </console> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <audio id='1' type='none'/> + <video> + <model type='cirrus' vram='16384' heads='1' primary='yes'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </video> + <watchdog model='itco' action='reset'/> + <memballoon model='none'/> + <panic model='isa'/> + </devices> + <launchSecurity type='tdx'> + <policy>0x1</policy> + <mrConfigId>xxx</mrConfigId> + <mrOwner>xxx</mrOwner> + <mrOwnerConfig>xxx</mrOwnerConfig> + <quoteGenerationService> + <SocketAddress type='vsock' cid='xxx' port='xxx'/> + </quoteGenerationService> + </launchSecurity> +</domain> diff --git a/tests/qemuxmlconfdata/launch-security-tdx-qgs-vsock.xml b/tests/qemuxmlconfdata/launch-security-tdx-qgs-vsock.xml new file mode 100644 index 0000000000..576714ae98 --- /dev/null +++ b/tests/qemuxmlconfdata/launch-security-tdx-qgs-vsock.xml @@ -0,0 +1,30 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory>4194304</memory> + <vcpu>4</vcpu> + <os> + <type arch='x86_64' machine='q35'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='usb'/> + <controller type='scsi'/> + <interface type='user'> + <mac address='52:54:00:09:a4:37'/> + </interface> + <serial type='pty'/> + <video/> + <memballoon model='none'/> + <panic/> + </devices> + <launchSecurity type='tdx'> + <policy>0x1</policy> + <mrConfigId>xxx</mrConfigId> + <mrOwner>xxx</mrOwner> + <mrOwnerConfig>xxx</mrOwnerConfig> + <quoteGenerationService> + <SocketAddress type='vsock' cid='xxx' port='xxx'/> + </quoteGenerationService> + </launchSecurity> +</domain> diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 1f9e8edef9..0476821342 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -2848,6 +2848,30 @@ mymain(void) QEMU_CAPS_SEV_GUEST, QEMU_CAPS_LAST); + DO_TEST_CAPS_ARCH_LATEST_FULL("launch-security-tdx-qgs-inet", + "x86_64", + ARG_QEMU_CAPS, + QEMU_CAPS_TDX_GUEST, + QEMU_CAPS_LAST); + + DO_TEST_CAPS_ARCH_LATEST_FULL("launch-security-tdx-qgs-unix", + "x86_64", + ARG_QEMU_CAPS, + QEMU_CAPS_TDX_GUEST, + QEMU_CAPS_LAST); + + DO_TEST_CAPS_ARCH_LATEST_FULL("launch-security-tdx-qgs-vsock", + "x86_64", + ARG_QEMU_CAPS, + QEMU_CAPS_TDX_GUEST, + QEMU_CAPS_LAST); + + DO_TEST_CAPS_ARCH_LATEST_FULL("launch-security-tdx-qgs-fd", + "x86_64", + ARG_QEMU_CAPS, + QEMU_CAPS_TDX_GUEST, + QEMU_CAPS_LAST); + DO_TEST_CAPS_ARCH_LATEST("launch-security-s390-pv", "s390x"); DO_TEST_CAPS_LATEST("vhost-user-fs-fd-memory"); -- 2.34.1