[PATCH v2 4/4] tests: Add test for virDomainGetSecurityLabelList

Luke Yue lukedyue at gmail.com
Fri Dec 3 14:19:57 UTC 2021


Signed-off-by: Luke Yue <lukedyue at gmail.com>
---
 tests/virshtest.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/tests/virshtest.c b/tests/virshtest.c
index 012edb8601..fc7caf6bc3 100644
--- a/tests/virshtest.c
+++ b/tests/virshtest.c
@@ -22,7 +22,8 @@ main(void)
 
 # define DOM_FC4_UUID "ef861801-45b9-11cb-88e3-afbfe5370493"
 # define DOM_FC5_UUID "08721f99-3d1d-4aec-96eb-97803297bb36"
-# define SECURITY_LABEL "libvirt-test (enforcing)"
+# define SECLABEL_ENFORCING "libvirt-test (enforcing)"
+# define SECLABEL_PERMISSIVE "libvirt-test (permissive)"
 # define FC4_MESSAGES "tainted: network configuration using opaque shell scripts"
 # define FC5_MESSAGES "tainted: running with undesirable elevated privileges\n\
                  tainted: network configuration using opaque shell scripts\n\
@@ -48,7 +49,7 @@ Autostart:       disable\n\
 Managed save:    no\n\
 Security model:  testSecurity\n\
 Security DOI:    \n\
-Security labels: " SECURITY_LABEL "\n\
+Security labels: " SECLABEL_ENFORCING "\n\
 Messages:        " FC4_MESSAGES "\n\
 \n";
 static const char *domuuid_fc4 = DOM_FC4_UUID "\n\n";
@@ -69,7 +70,8 @@ Autostart:       disable\n\
 Managed save:    no\n\
 Security model:  testSecurity\n\
 Security DOI:    \n\
-Security labels: " SECURITY_LABEL "\n\
+Security labels: " SECLABEL_ENFORCING "\n\
+                 " SECLABEL_PERMISSIVE "\n\
 Messages:        " FC5_MESSAGES "\n\
 \n";
 
@@ -238,7 +240,8 @@ static int testCompareDominfoByName(const void *data G_GNUC_UNUSED)
 
 static int testCompareTaintedDominfoByName(const void *data G_GNUC_UNUSED)
 {
-    const char *const argv[] = { VIRSH_CUSTOM, "dominfo", "fc5", NULL };
+    const char *const argv[] = { VIRSH_CUSTOM, "dominfo", "fc5",
+                                 "--full-seclabels", NULL };
     const char *exp = dominfo_fc5;
     return testCompareOutputLit(exp, "\nCPU time:", argv);
 }
-- 
2.34.1




More information about the libvir-list mailing list