From nobody Mon Apr 29 05:12:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1638541243110856.6231027677816; Fri, 3 Dec 2021 06:20:43 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-281-DBFaAXviO6qtNuEyHo9fNg-1; Fri, 03 Dec 2021 09:20:38 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 29B631926DBB; Fri, 3 Dec 2021 14:20:24 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9923E18831; Fri, 3 Dec 2021 14:20:23 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E95101809CB8; Fri, 3 Dec 2021 14:20:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1B3EKLQl026009 for ; Fri, 3 Dec 2021 09:20:21 -0500 Received: by smtp.corp.redhat.com (Postfix) id 80DA64047279; Fri, 3 Dec 2021 14:20:21 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7CFB24047272 for ; Fri, 3 Dec 2021 14:20:21 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6401B181E066 for ; Fri, 3 Dec 2021 14:20:21 +0000 (UTC) Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-417-b3YAFoG5NCq5zBotKj7uRg-1; Fri, 03 Dec 2021 09:20:19 -0500 Received: by mail-pj1-f51.google.com with SMTP id j6-20020a17090a588600b001a78a5ce46aso5324319pji.0 for ; Fri, 03 Dec 2021 06:20:18 -0800 (PST) Received: from localhost ([2400:ddc0:1000::b373:390c]) by smtp.gmail.com with ESMTPSA id h2sm3881784pfc.190.2021.12.03.06.20.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Dec 2021 06:20:16 -0800 (PST) X-MC-Unique: DBFaAXviO6qtNuEyHo9fNg-1 X-MC-Unique: b3YAFoG5NCq5zBotKj7uRg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZR5gouPux4tTEPgwndTqmqkwKCYoY9L6mKsQ0G112uw=; b=DXB4oabn0g+Q+FaHMPb+mf8tiV0jljhqKTjwVEJpCcb8CmxLAtppDSpM9SiEnmFudY bizL6rkvZWWTv0UFdjWrMypcsN/TFnoMy4l9J5w+ClTcrx3jQgtaPwY++jOEsnBuZsc7 aUmK+MICAE/w1a9W3/zku0icxnDPDh7VwNsNKPlUbLei+1+FCmLTsaXOCzHkIWDQrS6h NbkNUqSuJCSCWPDmYl3b5U6jzecVXXaPqOEYzErGGgE0waK2aKGujZxZK5f97gkM4HE+ +UwiFZp9e27+usq4AhIQJjcz/4e8+V2Fawe19pLjEbpN7ScPNnGUKm20ZEMXtVwxQYtW hAyQ== X-Gm-Message-State: AOAM532KRakXhzyy0ZBk1IuERFuPMBNq300SM1qAP7t2dbL1oUHv475F p2mBU8wUMre/Xi8PykFIG82qahqGlfwD4nXr X-Google-Smtp-Source: ABdhPJw0cjNvjNr2yk8Ddb2/UEWY33jY4WMfbSSmCOC4S5cHfOM9o6c/VphYoOYqm8KmYDZv70ulrw== X-Received: by 2002:a17:90a:909:: with SMTP id n9mr14500296pjn.1.1638541217169; Fri, 03 Dec 2021 06:20:17 -0800 (PST) From: Luke Yue To: libvir-list@redhat.com Subject: [PATCH v2 1/4] test_driver: Implement virDomainGetSecurityLabelList Date: Fri, 3 Dec 2021 22:19:54 +0800 Message-Id: <20211203141957.686148-2-lukedyue@gmail.com> In-Reply-To: <20211203141957.686148-1-lukedyue@gmail.com> References: <20211203141957.686148-1-lukedyue@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1638541244395100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Luke Yue --- src/test/test_driver.c | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index b6bca884f0..e9d009cfdb 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -137,6 +137,7 @@ VIR_ONCE_GLOBAL_INIT(testDriver); =20 #define TEST_MODEL "i686" #define TEST_EMULATOR "/usr/bin/test-hv" +#define TEST_SECURITY_LABEL_LIST_LENGTH 2 =20 static const virNodeInfo defaultNodeInfo =3D { TEST_MODEL, @@ -5275,6 +5276,47 @@ testDomainGetSecurityLabel(virDomainPtr dom, return ret; } =20 +static int +testDomainGetSecurityLabelList(virDomainPtr dom, + virSecurityLabelPtr* seclabels) +{ + virDomainObj *vm; + size_t i; + int ret =3D -1; + + if (!(vm =3D testDomObjFromDomain(dom))) + return -1; + + if (!virDomainObjIsActive(vm)) { + /* No seclabels */ + *seclabels =3D NULL; + ret =3D 0; + } else { + int len =3D TEST_SECURITY_LABEL_LIST_LENGTH; + + (*seclabels) =3D g_new0(virSecurityLabel, len); + memset(*seclabels, 0, sizeof(**seclabels) * len); + + /* Fill the array */ + for (i =3D 0; i < len; i++) { + if (virStrcpyStatic((*seclabels)[i].label, "libvirt-test") < 0= ) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("security label exceeds maximum: %zu"), + sizeof((*seclabels)[i].label) - 1); + g_clear_pointer(seclabels, g_free); + goto cleanup; + } + if (i =3D=3D 0) + (*seclabels)[i].enforcing =3D 1; + } + ret =3D len; + } + + cleanup: + virDomainObjEndAPI(&vm); + return ret; +} + static int testNodeGetSecurityModel(virConnectPtr conn, virSecurityModelPtr secmodel) @@ -10049,6 +10091,7 @@ static virHypervisorDriver testHypervisorDriver =3D= { .domainPinIOThread =3D testDomainPinIOThread, /* 7.8.0 */ .domainSetIOThreadParams =3D testDomainSetIOThreadParams, /* 7.8.0 */ .domainGetSecurityLabel =3D testDomainGetSecurityLabel, /* 7.5.0 */ + .domainGetSecurityLabelList =3D testDomainGetSecurityLabelList, /* 8.0= .0 */ .nodeGetSecurityModel =3D testNodeGetSecurityModel, /* 7.5.0 */ .domainGetXMLDesc =3D testDomainGetXMLDesc, /* 0.1.4 */ .domainSetMemoryParameters =3D testDomainSetMemoryParameters, /* 5.6.0= */ --=20 2.34.1 From nobody Mon Apr 29 05:12:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1638541245075670.6195915351981; Fri, 3 Dec 2021 06:20:45 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-104-CLe565TKMQySfyhI-gCyRQ-1; Fri, 03 Dec 2021 09:20:42 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 027B1835E31; Fri, 3 Dec 2021 14:20:34 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D81D2ADC5; Fri, 3 Dec 2021 14:20:33 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id AD2651809CB9; Fri, 3 Dec 2021 14:20:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1B3EKPqH026019 for ; Fri, 3 Dec 2021 09:20:25 -0500 Received: by smtp.corp.redhat.com (Postfix) id C05311402406; Fri, 3 Dec 2021 14:20:24 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BC5C11402408 for ; Fri, 3 Dec 2021 14:20:24 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 55FBF811E81 for ; Fri, 3 Dec 2021 14:20:24 +0000 (UTC) Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-284-4L_Rh853PmW7LOSiBKmoRg-1; Fri, 03 Dec 2021 09:20:22 -0500 Received: by mail-pf1-f181.google.com with SMTP id x5so3095746pfr.0 for ; Fri, 03 Dec 2021 06:20:22 -0800 (PST) Received: from localhost ([2400:ddc0:1000::b373:390c]) by smtp.gmail.com with ESMTPSA id o134sm3286374pfg.1.2021.12.03.06.20.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Dec 2021 06:20:20 -0800 (PST) X-MC-Unique: CLe565TKMQySfyhI-gCyRQ-1 X-MC-Unique: 4L_Rh853PmW7LOSiBKmoRg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+RF8cLULSOhPRpw60Mg/9ZSBDUlgEdCPoPQ2pvp+CLs=; b=3oX5XdgkJtveL0DMtev/NTd0Y/FsxiBU3+CBcMKlu5Jby8FvOMbipptEjyRngLjlnk 6RyAR3miBY7ZqRUIZ2ok8cnoQdeigzuvxCRIvpW3dWfKtuYij+letxj6jKqoELoRZ1Vh Dqpu4NTOnpuaM0qKZdW1z7OSTTpPH+rkuiforGC+EwS9d+0lxCQA4UUbgRf2gVAiL/Qv 2uMujGC6Qt4g1V58ScXklMRhkvSCVL9ZcXrdhHMwaOUqG70QbWhfFoy8VBy1kGMTbicQ NuDk5RsyAGsOnN87g9kBqtzR4EsCHRqj357fpeWFkvbrCYr6pEtid5X5nqGY8jZELnab SXPw== X-Gm-Message-State: AOAM531OHcSXcmNB4p77dmXDlrCoTn5dGyeGIwj9r31S+ykQoYdWjrwE 4QAgl5+AgNS74eLrhW8AHXvhZbXWH/TjxYc/ X-Google-Smtp-Source: ABdhPJy0vQMw4D071JjqsTe7CiWyQKB8WNN4SpqUU1PznlU7dVHw1zWauai1LHRIF2keO1I6nL+d7w== X-Received: by 2002:a63:30c:: with SMTP id 12mr4768437pgd.131.1638541220795; Fri, 03 Dec 2021 06:20:20 -0800 (PST) From: Luke Yue To: libvir-list@redhat.com Subject: [PATCH v2 2/4] virsh: Add '--full-seclabels' option for dominfo Date: Fri, 3 Dec 2021 22:19:55 +0800 Message-Id: <20211203141957.686148-3-lukedyue@gmail.com> In-Reply-To: <20211203141957.686148-1-lukedyue@gmail.com> References: <20211203141957.686148-1-lukedyue@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1638541247173100001 Content-Type: text/plain; charset="utf-8" There is no virsh command uses virDomainGetSecurityLabelList API, so add an option for dominfo to call it and print full list of security labels. Signed-off-by: Luke Yue --- docs/manpages/virsh.rst | 5 +++-- tools/virsh-domain-monitor.c | 43 +++++++++++++++++++++++++++++++----- 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index 39636a565e..54391b7557 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -2008,9 +2008,10 @@ dominfo =20 :: =20 - dominfo domain + dominfo domain [--full-seclabels] =20 -Returns basic information about the domain. +Returns basic information about the domain. *--full-seclabels* tells virsh +to print full list of security labels. =20 =20 domjobabort diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index eb3e0ef11a..1bb3bed1cb 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -1203,6 +1203,10 @@ static const vshCmdInfo info_dominfo[] =3D { =20 static const vshCmdOptDef opts_dominfo[] =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(0), + {.name =3D "full-seclabels", + .type =3D VSH_OT_BOOL, + .help =3D N_("Show full list of security labels of a domain") + }, {.name =3D NULL} }; =20 @@ -1222,6 +1226,7 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd) int has_managed_save =3D 0; virshControl *priv =3D ctl->privData; g_auto(GStrv) messages =3D NULL; + bool fullseclabels =3D vshCommandOptBool(cmd, "full-seclabels"); =20 if (!(dom =3D virshCommandOptDomain(ctl, cmd, NULL))) return false; @@ -1303,16 +1308,42 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd) vshPrint(ctl, "%-15s %s\n", _("Security model:"), secmodel.mod= el); vshPrint(ctl, "%-15s %s\n", _("Security DOI:"), secmodel.doi); =20 - /* Security labels are only valid for active domains */ - seclabel =3D g_new0(virSecurityLabel, 1); + if (fullseclabels) { + int len; + size_t i; =20 - if (virDomainGetSecurityLabel(dom, seclabel) =3D=3D -1) { - VIR_FREE(seclabel); - return false; + if ((len =3D virDomainGetSecurityLabelList(dom, &seclabel)= ) < 0) { + g_clear_pointer(&seclabel, g_free); + return false; + } + + for (i =3D 0; i < len; i++) + if (seclabel[i].label[0] !=3D '\0') + vshPrint(ctl, "%-16s %s (%s)\n", + i =3D=3D 0 ? _("Security labels:") : "", + seclabel[i].label, + seclabel[i].enforcing ? + "enforcing" : + "permissive"); + + g_clear_pointer(&seclabel, g_free); } else { + /* Security labels are only valid for active domains */ + seclabel =3D g_new0(virSecurityLabel, 1); + + if (virDomainGetSecurityLabel(dom, seclabel) < 0) { + g_clear_pointer(&seclabel, g_free); + return false; + } + if (seclabel->label[0] !=3D '\0') vshPrint(ctl, "%-15s %s (%s)\n", _("Security label:"), - seclabel->label, seclabel->enforcing ? "enfor= cing" : "permissive"); + seclabel->label, + seclabel->enforcing ? + "enforcing" : + "permissive"); + + g_clear_pointer(&seclabel, g_free); } =20 VIR_FREE(seclabel); --=20 2.34.1 From nobody Mon Apr 29 05:12:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1638541248322634.1017490431711; Fri, 3 Dec 2021 06:20:48 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-602-eeifrKq9PSGWWaWNUy7UAQ-1; Fri, 03 Dec 2021 09:20:43 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7F193100C693; Fri, 3 Dec 2021 14:20:37 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5E9265D9D5; Fri, 3 Dec 2021 14:20:37 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3455B1809CB8; Fri, 3 Dec 2021 14:20:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1B3EKap1026033 for ; Fri, 3 Dec 2021 09:20:36 -0500 Received: by smtp.corp.redhat.com (Postfix) id ECC8B1121315; Fri, 3 Dec 2021 14:20:35 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E80451121314 for ; Fri, 3 Dec 2021 14:20:30 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2CC5E106655A for ; Fri, 3 Dec 2021 14:20:30 +0000 (UTC) Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-256-JmDfkBdyOqOWf_H14-W0-g-1; Fri, 03 Dec 2021 09:20:27 -0500 Received: by mail-pj1-f50.google.com with SMTP id w33-20020a17090a6ba400b001a722a06212so5305704pjj.0 for ; Fri, 03 Dec 2021 06:20:26 -0800 (PST) Received: from localhost ([2400:ddc0:1000::b373:390c]) by smtp.gmail.com with ESMTPSA id lt5sm2566468pjb.43.2021.12.03.06.20.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Dec 2021 06:20:24 -0800 (PST) X-MC-Unique: eeifrKq9PSGWWaWNUy7UAQ-1 X-MC-Unique: JmDfkBdyOqOWf_H14-W0-g-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7xTbrVopCfaN1Ag/Wn+ydMElf3jP3thgkWcKYbLnku0=; b=y+CGFF9dj7E6rV2aLcD24Ji9lcKk6pY47HyjnXbjqUfkQqyZOhSrBcOFSLgYcHJs3H zIMqiVI6I1P/pccComWtZq35TSh0iGKX8ZuJH2NJnjeB2tsjfP3Q8LpOMAm9yW4qSxpD g+ucL4iIzEWDS524c9KcJoJJ1ZOr5mtDIuE2f6NxB2rsBbIx8cNW7Vrp/shCFoOt8Wuv Q1UooDQkS9TwcezHVPdCl7qSbo+aOgu9tkabqKosyKeZUFXCC+aYzI77U9ZpbvrJDATc BN4CVKaOF0Es8rltvHBzCksA2iJDbkXTMv6tcU6NUxRvPnODFahJHuwv1aTzltObWFpa uuLw== X-Gm-Message-State: AOAM533NVXd8VGFwfldTkZdj6Pm7rhFfyRCIVGHMDJ9WBG6P3DOFjSgf sWNHnQmd8pwOx20gT/3kFN0gbpSO4mwANr8I X-Google-Smtp-Source: ABdhPJyu+GIuUVfEvDpVQQYNdjKuZAfni+pmlOEm/z9P/oVpaG608BbNZ1SDC5oMsyO/HJt6aNAsaw== X-Received: by 2002:a17:902:8e85:b0:142:7621:e3b3 with SMTP id bg5-20020a1709028e8500b001427621e3b3mr23119799plb.84.1638541225222; Fri, 03 Dec 2021 06:20:25 -0800 (PST) From: Luke Yue To: libvir-list@redhat.com Subject: [PATCH v2 3/4] virsh: Realign some outputs Date: Fri, 3 Dec 2021 22:19:56 +0800 Message-Id: <20211203141957.686148-4-lukedyue@gmail.com> In-Reply-To: <20211203141957.686148-1-lukedyue@gmail.com> References: <20211203141957.686148-1-lukedyue@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1638541249665100001 Content-Type: text/plain; charset="utf-8" As it's now "Security labels:" instead of "Security label:". Signed-off-by: Luke Yue --- tests/virsh-undefine | 8 ++--- tests/virshtest.c | 70 ++++++++++++++++++------------------ tools/virsh-domain-monitor.c | 42 +++++++++++----------- 3 files changed, 59 insertions(+), 61 deletions(-) diff --git a/tests/virsh-undefine b/tests/virsh-undefine index dbbb367391..7feefdec79 100755 --- a/tests/virsh-undefine +++ b/tests/virsh-undefine @@ -35,11 +35,11 @@ $abs_top_builddir/tools/virsh -c test:///default \ test $? =3D 0 || fail=3D1 sed '/^Persistent/n; /:/d' < out1 > out cat <<\EOF > exp || fail=3D1 -Persistent: yes +Persistent: yes =20 Domain 'test' has been undefined =20 -Persistent: no +Persistent: no =20 EOF compare exp out || fail=3D1 @@ -50,11 +50,11 @@ $abs_top_builddir/tools/virsh -c test:///default \ test $? =3D 0 || fail=3D1 sed '/^Persistent/n; /:/d' < out1 > out cat <<\EOF > exp || fail=3D1 -Persistent: yes +Persistent: yes =20 Domain '1' has been undefined =20 -Persistent: no +Persistent: no =20 EOF compare exp out || fail=3D1 diff --git a/tests/virshtest.c b/tests/virshtest.c index c2c892c60d..012edb8601 100644 --- a/tests/virshtest.c +++ b/tests/virshtest.c @@ -25,52 +25,52 @@ main(void) # define SECURITY_LABEL "libvirt-test (enforcing)" # define FC4_MESSAGES "tainted: network configuration using opaque shell s= cripts" # define FC5_MESSAGES "tainted: running with undesirable elevated privileg= es\n\ - tainted: network configuration using opaque shell scripts\= n\ - tainted: use of host cdrom passthrough\n\ - tainted: custom device tree blob used\n\ - tainted: use of deprecated configuration settings\n\ - deprecated configuration: CPU model Deprecated-Test" + tainted: network configuration using opaque shell scripts= \n\ + tainted: use of host cdrom passthrough\n\ + tainted: custom device tree blob used\n\ + tainted: use of deprecated configuration settings\n\ + deprecated configuration: CPU model Deprecated-Test" # define GET_BLKIO_PARAMETER "/dev/hda,700" # define SET_BLKIO_PARAMETER "/dev/hda,1000" # define EQUAL "=3D" =20 static const char *dominfo_fc4 =3D "\ -Id: 2\n\ -Name: fc4\n\ -UUID: " DOM_FC4_UUID "\n\ -OS Type: linux\n\ -State: running\n\ -CPU(s): 1\n\ -Max memory: 261072 KiB\n\ -Used memory: 131072 KiB\n\ -Persistent: yes\n\ -Autostart: disable\n\ -Managed save: no\n\ -Security model: testSecurity\n\ -Security DOI: \n\ -Security label: " SECURITY_LABEL "\n\ -Messages: " FC4_MESSAGES "\n\ +Id: 2\n\ +Name: fc4\n\ +UUID: " DOM_FC4_UUID "\n\ +OS Type: linux\n\ +State: running\n\ +CPU(s): 1\n\ +Max memory: 261072 KiB\n\ +Used memory: 131072 KiB\n\ +Persistent: yes\n\ +Autostart: disable\n\ +Managed save: no\n\ +Security model: testSecurity\n\ +Security DOI: \n\ +Security labels: " SECURITY_LABEL "\n\ +Messages: " FC4_MESSAGES "\n\ \n"; static const char *domuuid_fc4 =3D DOM_FC4_UUID "\n\n"; static const char *domid_fc4 =3D "2\n\n"; static const char *domname_fc4 =3D "fc4\n\n"; static const char *domstate_fc4 =3D "running\n\n"; static const char *dominfo_fc5 =3D "\ -Id: 3\n\ -Name: fc5\n\ -UUID: " DOM_FC5_UUID "\n\ -OS Type: linux\n\ -State: running\n\ -CPU(s): 4\n\ -Max memory: 2097152 KiB\n\ -Used memory: 2097152 KiB\n\ -Persistent: yes\n\ -Autostart: disable\n\ -Managed save: no\n\ -Security model: testSecurity\n\ -Security DOI: \n\ -Security label: " SECURITY_LABEL "\n\ -Messages: " FC5_MESSAGES "\n\ +Id: 3\n\ +Name: fc5\n\ +UUID: " DOM_FC5_UUID "\n\ +OS Type: linux\n\ +State: running\n\ +CPU(s): 4\n\ +Max memory: 2097152 KiB\n\ +Used memory: 2097152 KiB\n\ +Persistent: yes\n\ +Autostart: disable\n\ +Managed save: no\n\ +Security model: testSecurity\n\ +Security DOI: \n\ +Security labels: " SECURITY_LABEL "\n\ +Messages: " FC5_MESSAGES "\n\ \n"; =20 static const char *get_blkio_parameters =3D "\ diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index 1bb3bed1cb..5ddf48cb06 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -1233,39 +1233,39 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd) =20 id =3D virDomainGetID(dom); if (id =3D=3D ((unsigned int)-1)) - vshPrint(ctl, "%-15s %s\n", _("Id:"), "-"); + vshPrint(ctl, "%-16s %s\n", _("Id:"), "-"); else - vshPrint(ctl, "%-15s %d\n", _("Id:"), id); - vshPrint(ctl, "%-15s %s\n", _("Name:"), virDomainGetName(dom)); + vshPrint(ctl, "%-16s %d\n", _("Id:"), id); + vshPrint(ctl, "%-16s %s\n", _("Name:"), virDomainGetName(dom)); =20 if (virDomainGetUUIDString(dom, &uuid[0]) =3D=3D 0) - vshPrint(ctl, "%-15s %s\n", _("UUID:"), uuid); + vshPrint(ctl, "%-16s %s\n", _("UUID:"), uuid); =20 if ((ostype =3D virDomainGetOSType(dom))) - vshPrint(ctl, "%-15s %s\n", _("OS Type:"), ostype); + vshPrint(ctl, "%-16s %s\n", _("OS Type:"), ostype); =20 if (virDomainGetInfo(dom, &info) =3D=3D 0) { - vshPrint(ctl, "%-15s %s\n", _("State:"), + vshPrint(ctl, "%-16s %s\n", _("State:"), virshDomainStateToString(info.state)); =20 - vshPrint(ctl, "%-15s %d\n", _("CPU(s):"), info.nrVirtCpu); + vshPrint(ctl, "%-16s %d\n", _("CPU(s):"), info.nrVirtCpu); =20 if (info.cpuTime !=3D 0) { double cpuUsed =3D info.cpuTime; =20 cpuUsed /=3D 1000000000.0; =20 - vshPrint(ctl, "%-15s %.1lfs\n", _("CPU time:"), cpuUsed); + vshPrint(ctl, "%-16s %.1lfs\n", _("CPU time:"), cpuUsed); } =20 if (info.maxMem !=3D UINT_MAX) - vshPrint(ctl, "%-15s %lu KiB\n", _("Max memory:"), + vshPrint(ctl, "%-16s %lu KiB\n", _("Max memory:"), info.maxMem); else - vshPrint(ctl, "%-15s %s\n", _("Max memory:"), + vshPrint(ctl, "%-16s %s\n", _("Max memory:"), _("no limit")); =20 - vshPrint(ctl, "%-15s %lu KiB\n", _("Used memory:"), + vshPrint(ctl, "%-16s %lu KiB\n", _("Used memory:"), info.memory); =20 } else { @@ -1277,21 +1277,21 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd) vshDebug(ctl, VSH_ERR_DEBUG, "Domain persistent flag value: %d\n", persistent); if (persistent < 0) - vshPrint(ctl, "%-15s %s\n", _("Persistent:"), _("unknown")); + vshPrint(ctl, "%-16s %s\n", _("Persistent:"), _("unknown")); else - vshPrint(ctl, "%-15s %s\n", _("Persistent:"), persistent ? _("yes"= ) : _("no")); + vshPrint(ctl, "%-16s %s\n", _("Persistent:"), persistent ? _("yes"= ) : _("no")); =20 /* Check and display whether the domain autostarts or not */ if (!virDomainGetAutostart(dom, &autostart)) { - vshPrint(ctl, "%-15s %s\n", _("Autostart:"), + vshPrint(ctl, "%-16s %s\n", _("Autostart:"), autostart ? _("enable") : _("disable")); } =20 has_managed_save =3D virDomainHasManagedSaveImage(dom, 0); if (has_managed_save < 0) - vshPrint(ctl, "%-15s %s\n", _("Managed save:"), _("unknown")); + vshPrint(ctl, "%-16s %s\n", _("Managed save:"), _("unknown")); else - vshPrint(ctl, "%-15s %s\n", _("Managed save:"), + vshPrint(ctl, "%-16s %s\n", _("Managed save:"), has_managed_save ? _("yes") : _("no")); =20 /* Security model and label information */ @@ -1305,8 +1305,8 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd) } else { /* Only print something if a security model is active */ if (secmodel.model[0] !=3D '\0') { - vshPrint(ctl, "%-15s %s\n", _("Security model:"), secmodel.mod= el); - vshPrint(ctl, "%-15s %s\n", _("Security DOI:"), secmodel.doi); + vshPrint(ctl, "%-16s %s\n", _("Security model:"), secmodel.mod= el); + vshPrint(ctl, "%-16s %s\n", _("Security DOI:"), secmodel.doi); =20 if (fullseclabels) { int len; @@ -1337,7 +1337,7 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd) } =20 if (seclabel->label[0] !=3D '\0') - vshPrint(ctl, "%-15s %s (%s)\n", _("Security label:"), + vshPrint(ctl, "%-16s %s (%s)\n", _("Security labels:"), seclabel->label, seclabel->enforcing ? "enforcing" : @@ -1345,15 +1345,13 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd) =20 g_clear_pointer(&seclabel, g_free); } - - VIR_FREE(seclabel); } } =20 if (virDomainGetMessages(dom, &messages, 0) > 0) { size_t i; for (i =3D 0; messages[i] !=3D NULL; i++) { - vshPrint(ctl, "%-15s %s\n", + vshPrint(ctl, "%-16s %s\n", i =3D=3D 0 ? _("Messages:") : "", messages[i]); } } --=20 2.34.1 From nobody Mon Apr 29 05:12:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 16385412748014.766965366924069; Fri, 3 Dec 2021 06:21:14 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-293-jvaGk1FXPie_9ZiZRfnYtQ-1; Fri, 03 Dec 2021 09:20:47 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5ED701937FC3; Fri, 3 Dec 2021 14:20:42 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3EB2760CC3; Fri, 3 Dec 2021 14:20:42 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 139C84BB7C; Fri, 3 Dec 2021 14:20:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1B3EKfuH026044 for ; Fri, 3 Dec 2021 09:20:41 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4C12D2166B46; Fri, 3 Dec 2021 14:20:41 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 43F222166B3F for ; Fri, 3 Dec 2021 14:20:34 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 34191185A7BA for ; Fri, 3 Dec 2021 14:20:34 +0000 (UTC) Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-310-Ysb-kwS9OWuwTmT-wUFaUw-1; Fri, 03 Dec 2021 09:20:30 -0500 Received: by mail-pf1-f169.google.com with SMTP id n85so3025935pfd.10 for ; Fri, 03 Dec 2021 06:20:30 -0800 (PST) Received: from localhost ([2400:ddc0:1000::b373:390c]) by smtp.gmail.com with ESMTPSA id c81sm3396669pfb.166.2021.12.03.06.20.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Dec 2021 06:20:28 -0800 (PST) X-MC-Unique: jvaGk1FXPie_9ZiZRfnYtQ-1 X-MC-Unique: Ysb-kwS9OWuwTmT-wUFaUw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=k0NlpAlnsONFhABdIIb7SKTbJG1tAflb8OrrgwurNbc=; b=zkjt5dgIHP7nL3bsVr/BCtDNNHJW7DnvrryT/D6TbTwh/HKsHwLmes4rJZxnAYRSII N6gdjz3upefoRQ3v0c8lIPKHuNiFaLSjhmAgJ9CvayFXWKvttMiZkhptaheT1PwB9BIb oUCA2EUoujshpRp/CPfSE5yWgnqFZTwoqp5m+5vV2Hzwuf9U3VbxXAmCMsw/+okRXnZq W/9VkVTQK25HJePRY6zfp/v3vgpJYN3KxY2GeJX89xfARc10FDqYAAA+AQ0aG40RyjzQ eE9mherXK5zq9rLQWhws68JdAP8ThScN0g6hG/eSxr4f+OHoWrG/TQrarBgB0XXZ0TpC E6dA== X-Gm-Message-State: AOAM532nHcTzUqcaMwSr0+qAxyNnTKoAFczG9d1QXWj26XNpJyk/z25z du/M4PTKWwvNai8qgUBYuP/8BN0qN3ngbNY3 X-Google-Smtp-Source: ABdhPJx7S0zR8VAyLOFwIWgrvBN0qpAqyPhfP8UX+SYUhTe0lmn4jtieEqgHqp4RSFXzSTQFqnNrvA== X-Received: by 2002:a63:5204:: with SMTP id g4mr4719509pgb.319.1638541229540; Fri, 03 Dec 2021 06:20:29 -0800 (PST) From: Luke Yue To: libvir-list@redhat.com Subject: [PATCH v2 4/4] tests: Add test for virDomainGetSecurityLabelList Date: Fri, 3 Dec 2021 22:19:57 +0800 Message-Id: <20211203141957.686148-5-lukedyue@gmail.com> In-Reply-To: <20211203141957.686148-1-lukedyue@gmail.com> References: <20211203141957.686148-1-lukedyue@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1638541275407100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Luke Yue --- 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) =20 # 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 s= cripts" # define FC5_MESSAGES "tainted: running with undesirable elevated privileg= es\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 =3D 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"; =20 @@ -238,7 +240,8 @@ static int testCompareDominfoByName(const void *data G_= GNUC_UNUSED) =20 static int testCompareTaintedDominfoByName(const void *data G_GNUC_UNUSED) { - const char *const argv[] =3D { VIRSH_CUSTOM, "dominfo", "fc5", NULL }; + const char *const argv[] =3D { VIRSH_CUSTOM, "dominfo", "fc5", + "--full-seclabels", NULL }; const char *exp =3D dominfo_fc5; return testCompareOutputLit(exp, "\nCPU time:", argv); } --=20 2.34.1