[libvirt] [sandbox PATCH v2 18/19] Add testcase for custom environment variables

Eren Yagdiran erenyagdiran at gmail.com
Tue Aug 4 20:11:24 UTC 2015


"make check" now includes testcase for environment variables
---
 libvirt-sandbox/tests/test-config.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/libvirt-sandbox/tests/test-config.c b/libvirt-sandbox/tests/test-config.c
index da05187..ac10bab 100644
--- a/libvirt-sandbox/tests/test-config.c
+++ b/libvirt-sandbox/tests/test-config.c
@@ -58,6 +58,13 @@ int main(int argc, char **argv)
         "host-bind:/tmp=",
         NULL
     };
+
+     const gchar *envs[] = {
+        "key1=val1",
+        "key2=val2",
+        NULL
+    };
+
     const gchar *disks[] = {
         "file:dbdata=/tmp/img.blah,format=qcow2",
         "file:cache=/tmp/img.qcow2",
@@ -103,6 +110,9 @@ int main(int argc, char **argv)
     if (!gvir_sandbox_config_add_mount_strv(cfg1, (gchar**)mounts, &err))
         goto cleanup;
 
+    if (!gvir_sandbox_config_add_env_strv(cfg1, (gchar**)envs, &err))
+        goto cleanup;
+
     if (!gvir_sandbox_config_add_disk_strv(cfg1, (gchar**)disks, &err))
         goto cleanup;
 
-- 
2.1.0




More information about the libvir-list mailing list