[PATCH 4/5] tests: add tests for 'papr-pef' support

Daniel Henrique Barboza danielhb413 at gmail.com
Wed Jun 2 14:36:25 UTC 2021


Signed-off-by: Daniel Henrique Barboza <danielhb413 at gmail.com>
---
 .../launch-security-papr-pef.xml              | 22 ++++++++++++++
 tests/genericxml2xmltest.c                    |  1 +
 ...y-papr-pef-ignore-policy.ppc64-latest.args | 30 +++++++++++++++++++
 ...launch-security-papr-pef-ignore-policy.xml | 19 ++++++++++++
 ...launch-security-papr-pef.ppc64-latest.args | 30 +++++++++++++++++++
 .../launch-security-papr-pef.xml              | 16 ++++++++++
 tests/qemuxml2argvtest.c                      |  3 ++
 7 files changed, 121 insertions(+)
 create mode 100644 tests/genericxml2xmlindata/launch-security-papr-pef.xml
 create mode 100644 tests/qemuxml2argvdata/launch-security-papr-pef-ignore-policy.ppc64-latest.args
 create mode 100644 tests/qemuxml2argvdata/launch-security-papr-pef-ignore-policy.xml
 create mode 100644 tests/qemuxml2argvdata/launch-security-papr-pef.ppc64-latest.args
 create mode 100644 tests/qemuxml2argvdata/launch-security-papr-pef.xml

diff --git a/tests/genericxml2xmlindata/launch-security-papr-pef.xml b/tests/genericxml2xmlindata/launch-security-papr-pef.xml
new file mode 100644
index 0000000000..f5a9fe9ed2
--- /dev/null
+++ b/tests/genericxml2xmlindata/launch-security-papr-pef.xml
@@ -0,0 +1,22 @@
+<domain type='qemu'>
+  <name>guest</name>
+  <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+  <memory unit='KiB'>524288</memory>
+  <currentMemory unit='KiB'>524288</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='ppc64' machine='pseries'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-ppc64</emulator>
+    <controller type='pci' index='0' model='pci-root'/>
+    <controller type='usb' index='0' model='none'/>
+    <memballoon model='none'/>
+  </devices>
+  <launchSecurity type='papr-pef'/>
+</domain>
diff --git a/tests/genericxml2xmltest.c b/tests/genericxml2xmltest.c
index eb15f66c3c..82decff827 100644
--- a/tests/genericxml2xmltest.c
+++ b/tests/genericxml2xmltest.c
@@ -235,6 +235,7 @@ mymain(void)
     DO_TEST("launch-security-sev");
     DO_TEST("launch-security-s390-pv");
     DO_TEST_DIFFERENT("launch-security-s390-pv-ignore-policy");
+    DO_TEST("launch-security-papr-pef");
 
     DO_TEST_DIFFERENT("cputune");
     DO_TEST("device-backenddomain");
diff --git a/tests/qemuxml2argvdata/launch-security-papr-pef-ignore-policy.ppc64-latest.args b/tests/qemuxml2argvdata/launch-security-papr-pef-ignore-policy.ppc64-latest.args
new file mode 100644
index 0000000000..6ea120c2d1
--- /dev/null
+++ b/tests/qemuxml2argvdata/launch-security-papr-pef-ignore-policy.ppc64-latest.args
@@ -0,0 +1,30 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-guest \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-guest/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-guest/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
+/usr/bin/qemu-system-ppc64 \
+-name guest=guest,debug-threads=on \
+-S \
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-guest/master-key.aes"}' \
+-machine pseries,accel=tcg,usb=off,dump-guest-core=off,confidential-guest-support=pef0,memory-backend=ppc_spapr.ram \
+-cpu POWER9 \
+-m 512 \
+-object '{"qom-type":"memory-backend-ram","id":"ppc_spapr.ram","size":536870912}' \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-boot strict=on \
+-audiodev id=audio1,driver=none \
+-object '{"qom-type":"pef-guest","id":"pef0"}' \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/launch-security-papr-pef-ignore-policy.xml b/tests/qemuxml2argvdata/launch-security-papr-pef-ignore-policy.xml
new file mode 100644
index 0000000000..07b635395f
--- /dev/null
+++ b/tests/qemuxml2argvdata/launch-security-papr-pef-ignore-policy.xml
@@ -0,0 +1,19 @@
+<domain type='qemu'>
+  <name>guest</name>
+  <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+  <memory unit='KiB'>524288</memory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='ppc64' machine='pseries'>hvm</type>
+  </os>
+  <devices>
+    <emulator>/usr/bin/qemu-system-ppc64</emulator>
+    <controller type='pci' model='pci-root'/>
+    <controller type='usb' model='none'/>
+    <memballoon model='none'/>
+  </devices>
+  <launchSecurity type='papr-pef'>
+    <dhCert>AQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAA</dhCert>
+    <session>IHAVENOIDEABUTJUSTPROVIDINGASTRING</session>
+  </launchSecurity>
+</domain>
diff --git a/tests/qemuxml2argvdata/launch-security-papr-pef.ppc64-latest.args b/tests/qemuxml2argvdata/launch-security-papr-pef.ppc64-latest.args
new file mode 100644
index 0000000000..6ea120c2d1
--- /dev/null
+++ b/tests/qemuxml2argvdata/launch-security-papr-pef.ppc64-latest.args
@@ -0,0 +1,30 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-guest \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-guest/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-guest/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
+/usr/bin/qemu-system-ppc64 \
+-name guest=guest,debug-threads=on \
+-S \
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-guest/master-key.aes"}' \
+-machine pseries,accel=tcg,usb=off,dump-guest-core=off,confidential-guest-support=pef0,memory-backend=ppc_spapr.ram \
+-cpu POWER9 \
+-m 512 \
+-object '{"qom-type":"memory-backend-ram","id":"ppc_spapr.ram","size":536870912}' \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-boot strict=on \
+-audiodev id=audio1,driver=none \
+-object '{"qom-type":"pef-guest","id":"pef0"}' \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/launch-security-papr-pef.xml b/tests/qemuxml2argvdata/launch-security-papr-pef.xml
new file mode 100644
index 0000000000..2d49658054
--- /dev/null
+++ b/tests/qemuxml2argvdata/launch-security-papr-pef.xml
@@ -0,0 +1,16 @@
+<domain type='qemu'>
+  <name>guest</name>
+  <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+  <memory unit='KiB'>524288</memory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='ppc64' machine='pseries'>hvm</type>
+  </os>
+  <devices>
+    <emulator>/usr/bin/qemu-system-ppc64</emulator>
+    <controller type='pci' model='pci-root'/>
+    <controller type='usb' model='none'/>
+    <memballoon model='none'/>
+  </devices>
+  <launchSecurity type='papr-pef'/>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 4b76c15189..0c084f62bd 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -3495,6 +3495,9 @@ mymain(void)
     DO_TEST_CAPS_ARCH_LATEST("launch-security-s390-pv", "s390x");
     DO_TEST_CAPS_ARCH_LATEST("launch-security-s390-pv-ignore-policy", "s390x");
 
+    DO_TEST_CAPS_ARCH_LATEST("launch-security-papr-pef", "ppc64");
+    DO_TEST_CAPS_ARCH_LATEST("launch-security-papr-pef-ignore-policy", "ppc64");
+
     DO_TEST_CAPS_LATEST("vhost-user-fs-fd-memory");
     DO_TEST_CAPS_LATEST("vhost-user-fs-hugepages");
     DO_TEST_CAPS_LATEST_PARSE_ERROR("vhost-user-fs-readonly");
-- 
2.31.1




More information about the libvir-list mailing list