[libvirt] [PATCH] Fix PKI directory used for QEMU test suite

From: "Daniel P. Berrange" <berrange@redhat.com> The data files for testing QEMU command line generation are hardcoded to use /etc/pki, so we should explicitly set that in the test case, avoiding the dynamic SYSCONFDIR value. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- tests/qemuxml2argvtest.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index c0c720e..c2a379d 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -282,6 +282,13 @@ mymain(void) VIR_FREE(driver.config->spiceListen); VIR_FREE(driver.config->vncListen); + VIR_FREE(driver.config->vncTLSx509certdir); + if ((driver.config->vncTLSx509certdir = strdup("/etc/pki/libvirt-vnc")) == NULL) + return EXIT_FAILURE; + VIR_FREE(driver.config->spiceTLSx509certdir); + if ((driver.config->spiceTLSx509certdir = strdup("/etc/pki/libvirt-spice")) == NULL) + return EXIT_FAILURE; + if ((driver.caps = testQemuCapsInit()) == NULL) return EXIT_FAILURE; VIR_FREE(driver.config->stateDir); -- 1.8.1

On 02/07/2013 09:40 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
The data files for testing QEMU command line generation are hardcoded to use /etc/pki, so we should explicitly set that in the test case, avoiding the dynamic SYSCONFDIR value.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- tests/qemuxml2argvtest.c | 7 +++++++ 1 file changed, 7 insertions(+)
ACK. I confirmed via strace that we are not actually accessing the file system for /etc/pki, so it is all just string manipulation for the purpose of the test. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 02/07/2013 05:40 PM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
The data files for testing QEMU command line generation are hardcoded to use /etc/pki, so we should explicitly set that in the test case, avoiding the dynamic SYSCONFDIR value.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- tests/qemuxml2argvtest.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index c0c720e..c2a379d 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -282,6 +282,13 @@ mymain(void) VIR_FREE(driver.config->spiceListen); VIR_FREE(driver.config->vncListen);
+ VIR_FREE(driver.config->vncTLSx509certdir); + if ((driver.config->vncTLSx509certdir = strdup("/etc/pki/libvirt-vnc")) == NULL) + return EXIT_FAILURE; + VIR_FREE(driver.config->spiceTLSx509certdir); + if ((driver.config->spiceTLSx509certdir = strdup("/etc/pki/libvirt-spice")) == NULL) + return EXIT_FAILURE; + if ((driver.caps = testQemuCapsInit()) == NULL) return EXIT_FAILURE; VIR_FREE(driver.config->stateDir);
+1 -- Mit freundlichen Grüßen/Kind Regards Viktor Mihajlovski IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Martin Jetter Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294
participants (3)
-
Daniel P. Berrange
-
Eric Blake
-
Viktor Mihajlovski