From 22b7247d48fae8ad8e2fa4fcbfc1c6d54820b095 Mon Sep 17 00:00:00 2001 From: Anya Harter Date: Fri, 15 Jun 2018 10:45:05 -0400 Subject: [PATCH] tests: add test file for smartcard database Add test case explicitly defining a smartcard host certificates database via the following xml: /tmp/foo This case is not currently covered in the test suite. Signed-off-by: Anya Harter Reviewed-by: John Ferlan --- .../smartcard-host-certificates-database.args | 28 +++++++++++++++ .../smartcard-host-certificates-database.xml | 21 +++++++++++ tests/qemuxml2argvtest.c | 2 ++ .../smartcard-host-certificates-database.xml | 35 +++++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 5 files changed, 87 insertions(+) create mode 100644 tests/qemuxml2argvdata/smartcard-host-certificates-database.args create mode 100644 tests/qemuxml2argvdata/smartcard-host-certificates-database.xml create mode 100644 tests/qemuxml2xmloutdata/smartcard-host-certificates-database.xml diff --git a/tests/qemuxml2argvdata/smartcard-host-certificates-database.args b/tests/qemuxml2argvdata/smartcard-host-certificates-database.args new file mode 100644 index 0000000000..bc159f234d --- /dev/null +++ b/tests/qemuxml2argvdata/smartcard-host-certificates-database.args @@ -0,0 +1,28 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-i686 \ +-name QEMUGuest1 \ +-S \ +-machine pc,accel=tcg,usb=off,dump-guest-core=off \ +-m 214 \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ +server,nowait \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-no-acpi \ +-boot c \ +-device usb-ccid,id=ccid0,bus=usb.0,port=1 \ +-usb \ +-device ccid-card-emulated,backend=certificates,cert1=cert1,cert2=cert2,\ +cert3=cert3,db=/tmp/foo,id=smartcard0,bus=ccid0.0 \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/smartcard-host-certificates-database.xml b/tests/qemuxml2argvdata/smartcard-host-certificates-database.xml new file mode 100644 index 0000000000..fa35645736 --- /dev/null +++ b/tests/qemuxml2argvdata/smartcard-host-certificates-database.xml @@ -0,0 +1,21 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + /usr/bin/qemu-system-i686 + + cert1 + cert2 + cert3 + /tmp/foo + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index f44cac9fef..194a8d2bab 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1404,6 +1404,8 @@ mymain(void) QEMU_CAPS_CCID_EMULATED); DO_TEST("smartcard-host-certificates", QEMU_CAPS_CCID_EMULATED); + DO_TEST("smartcard-host-certificates-database", + QEMU_CAPS_CCID_EMULATED); DO_TEST("smartcard-passthrough-tcp", QEMU_CAPS_CCID_PASSTHRU); DO_TEST("smartcard-passthrough-spicevmc", diff --git a/tests/qemuxml2xmloutdata/smartcard-host-certificates-database.xml b/tests/qemuxml2xmloutdata/smartcard-host-certificates-database.xml new file mode 100644 index 0000000000..55d54a4355 --- /dev/null +++ b/tests/qemuxml2xmloutdata/smartcard-host-certificates-database.xml @@ -0,0 +1,35 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + +
+ + + + + cert1 + cert2 + cert3 + /tmp/foo +
+ + + + +
+ + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index f5805c7f50..4449954ad4 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1163,6 +1163,7 @@ mymain(void) DO_TEST("smartcard-host", NONE); DO_TEST("smartcard-host-certificates", NONE); + DO_TEST("smartcard-host-certificates-database", NONE); DO_TEST("smartcard-passthrough-tcp", NONE); DO_TEST("smartcard-passthrough-spicevmc", NONE); DO_TEST("smartcard-controller", NONE);