From patchwork Sat Aug 27 09:21:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Iooss X-Patchwork-Id: 9302341 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7CE746077C for ; Sat, 27 Aug 2016 09:28:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57FDC29042 for ; Sat, 27 Aug 2016 09:28:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 370B929057; Sat, 27 Aug 2016 09:28:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from emsm-gh1-uea11.nsa.gov (emsm-gh1-uea11.nsa.gov [8.44.101.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9543A29042 for ; Sat, 27 Aug 2016 09:28:02 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.28,586,1464652800"; d="scan'208";a="18801480" IronPort-PHdr: =?us-ascii?q?9a23=3AuyJehxN4WSbL+WPFB+gl6mtUPXoX/o7sNwtQ0KIM?= =?us-ascii?q?zox0KPv4rarrMEGX3/hxlliBBdydsKMdzbaM+Pi+ESxYuNDa4ShEKMQNHzY+yu?= =?us-ascii?q?wu1zQ6B8CEDUCpZNXLVAcdWPp4aVl+4nugOlJUEsutL3fbo3m18CJAUk6nbVk9?= =?us-ascii?q?GO35F8bogtit0KjqotuIMlwO2GD2Oe06bE3v616A7o9O2coqA51y4yOBmmFPde?= =?us-ascii?q?VSyDEgDnOotDG42P2N+oV++T9bofMr+p0Ie6z7e6MlUe4QV2x+YCgI/smjiT3v?= =?us-ascii?q?BUvKuDpPGlkRxwFFBwnD8QHSQob6siy8sPF0niadI57YV7cxDBKj5KBvQQSgqS?= =?us-ascii?q?AALCVxpGfWgct0hbkdoRWmvAdXxtLEJoaPO6wtLevmYdoGSD8ZDY5qXCtbD9b5?= =?us-ascii?q?MYY=3D?= X-IPAS-Result: =?us-ascii?q?A2ELBQCFXMFX/wHyM5BdHAEBBAEBGQaDCgEBAQEBHlZ8uWk?= =?us-ascii?q?3IgeHQUwBAQEBAQEBAQIBAlsngjIEAxMFBAE5PAEBAQEBASMCGlICBAECJBMUI?= =?us-ascii?q?A4DCQEBFykICAMBLRURDgsFGASIHwQBtXyKGoYuiF8RAWiFEAWIJoc1iXSBZIQ?= =?us-ascii?q?8iQGCRYc3hWNIj3VUgjQcgU5uhC14gScBAQE?= Received: from unknown (HELO tarius.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea11.nsa.gov with ESMTP; 27 Aug 2016 09:27:59 +0000 Received: from prometheus.infosec.tycho.ncsc.mil (prometheus [192.168.25.40]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id u7R9Rhg9006404; Sat, 27 Aug 2016 05:27:46 -0400 Received: from tarius.tycho.ncsc.mil (tarius.infosec.tycho.ncsc.mil [144.51.242.1]) by prometheus.infosec.tycho.ncsc.mil (8.15.2/8.15.2) with ESMTP id u7R9NPv1022724 for ; Sat, 27 Aug 2016 05:23:25 -0400 Received: from goalie.tycho.ncsc.mil (goalie [144.51.242.250]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id u7R9NOdv006173 for ; Sat, 27 Aug 2016 05:23:25 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1CTAwCTW8FXfSIeaIFdHQEFAYMpAQEBAQF0fLYZhCQMh0FMAQIBAQEBAQITAQELFAmFKgYnYlFXGYhABAG1fIoahi6JWYUQBYgmhzWJdIFkhDyJAYJFjRpIj3WCNgxGHIFOboZMAQEB X-IPAS-Result: A1CTAwCTW8FXfSIeaIFdHQEFAYMpAQEBAQF0fLYZhCQMh0FMAQIBAQEBAQITAQELFAmFKgYnYlFXGYhABAG1fIoahi6JWYUQBYgmhzWJdIFkhDyJAYJFjRpIj3WCNgxGHIFOboZMAQEB X-IronPort-AV: E=Sophos;i="5.28,586,1464667200"; d="scan'208";a="5668306" Received: from emsm-gh1-uea10.corp.nsa.gov (HELO emsm-gh1-uea10.nsa.gov) ([10.208.41.36]) by goalie.tycho.ncsc.mil with ESMTP; 27 Aug 2016 05:23:18 -0400 IronPort-PHdr: =?us-ascii?q?9a23=3AtRN5hRZb+A7KwQpTVn6ibYv/LSx+4OfEezUN459i?= =?us-ascii?q?sYplN5qZpcq6bnLW6fgltlLVR4KTs6sC0LuP9fy6EjReqdbZ6TZZIcQKD0dEwe?= =?us-ascii?q?wt3CUYSPafDkP6KPO4JwcbJ+9lEGFfwnegLEJOE9z/bVCB6le77DoVBwmtfVEt?= =?us-ascii?q?fre9JIfegoyN2vyo/NWLOkMT1WP7Pek5dEv+7V2I8JJH2c06cud54yCKi0MAQ/?= =?us-ascii?q?5Ry2JsKADbtDfHzeD0wqRe9T9Nsekq7c9KXPayVa05SbtFEGZuaDhtt4W4/SXE?= =?us-ascii?q?GBCC4noaT3U+jgtDAw+D6grzGJj2rHjUrO14jQ+bNsryRKt8eDOl9LwjHBnpgy?= =?us-ascii?q?ADPiV/8WbQkddYif5L5hW7qEoskMbvfIiJOa8mLevmdtQASD8ZUw=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0HCAwBVW8FXfSIeaIFdHQEFARgGgwsBA?= =?us-ascii?q?QEBAXR8thmDUFQMh0FMAQEBAQEBAQECAQIQAQELFAlIgjIYCwE5PAEBAQEBASM?= =?us-ascii?q?CGlIGJ2JRVxmIQAQBtXyKGoYuiVmFEAWIJoc1iXSBZIQ8iQGCRY0aSI91gjYMR?= =?us-ascii?q?hyBTm6GTAEBAQ?= X-IPAS-Result: =?us-ascii?q?A0HCAwBVW8FXfSIeaIFdHQEFARgGgwsBAQEBAXR8thmDUFQ?= =?us-ascii?q?Mh0FMAQEBAQEBAQECAQIQAQELFAlIgjIYCwE5PAEBAQEBASMCGlIGJ2JRVxmIQ?= =?us-ascii?q?AQBtXyKGoYuiVmFEAWIJoc1iXSBZIQ8iQGCRY0aSI91gjYMRhyBTm6GTAEBAQ?= X-IronPort-AV: E=Sophos;i="5.28,586,1464652800"; d="scan'208";a="17004033" Received: from mx1.polytechnique.org ([129.104.30.34]) by emsm-gh1-uea10.nsa.gov with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Aug 2016 09:23:17 +0000 Received: from localhost.localdomain (32.206.133.77.rev.sfr.net [77.133.206.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ssl.polytechnique.org (Postfix) with ESMTPSA id BD4FA5646D7 for ; Sat, 27 Aug 2016 11:23:15 +0200 (CEST) From: Nicolas Iooss To: selinux@tycho.nsa.gov Subject: [PATCH 2/3] libsepol: tests: fix g_b_role_2 test Date: Sat, 27 Aug 2016 11:21:48 +0200 Message-Id: <20160827092149.9277-3-nicolas.iooss@m4x.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160827092149.9277-1-nicolas.iooss@m4x.org> References: <20160827092149.9277-1-nicolas.iooss@m4x.org> X-AV-Checked: ClamAV using ClamSMTP at svoboda.polytechnique.org (Sat Aug 27 11:23:15 2016 +0200 (CEST)) X-Org-Mail: nicolas.iooss.2010@polytechnique.org X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: MIME-Version: 1.0 Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Virus-Scanned: ClamAV using ClamSMTP Even though g_b_role_2 is used both in tests/policies/test-linker/small-base.conf and tests/policies/test-linker/module1.conf, it seems to only exists in the scope of the base policy. This fixes the following failure of "make -C libsepol test": ./libsepol-tests CUnit - A unit testing framework for C - Version 2.1-3 http://cunit.sourceforge.net/ Suite: cond Test: cond_expr_equal ...passed Suite: linker Test: linker_indexes ...passed Test: linker_types ...passed Test: linker_roles ...sym g_b_role_2 has 1 decls, 2 expected FAILED 1. test-common.c:43 - scope->decl_ids_len == len 2. test-common.c:52 - found == 1 Test: linker_cond ...passed Suite: expander Test: expander_indexes ...passed Test: expander_attr_mapping ...passed Test: expander_role_mapping ...passed Test: expander_user_mapping ...passed Test: expander_alias ...passed Suite: deps Test: deps_modreq_global ...passed Test: deps_modreq_opt ...passed Suite: downgrade Test: downgrade ...passed Run Summary: Type Total Ran Passed Failed Inactive suites 5 5 n/a 0 0 tests 13 13 12 1 0 asserts 1274 1274 1272 2 n/a Signed-off-by: Nicolas Iooss --- libsepol/tests/test-linker-roles.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libsepol/tests/test-linker-roles.c b/libsepol/tests/test-linker-roles.c index 2c4a804704d6..569e2ccf5ee7 100644 --- a/libsepol/tests/test-linker-roles.c +++ b/libsepol/tests/test-linker-roles.c @@ -132,8 +132,7 @@ void module_role_tests(policydb_t * base) /**** test for type added to base role in module 1 (global) ****/ decls[0] = (test_find_decl_by_sym(base, SYM_TYPES, "tag_g_b"))->decl_id; - decls[1] = (test_find_decl_by_sym(base, SYM_TYPES, "tag_g_m1"))->decl_id; - test_sym_presence(base, "g_b_role_2", SYM_ROLES, SCOPE_DECL, decls, 2); + test_sym_presence(base, "g_b_role_2", SYM_ROLES, SCOPE_DECL, decls, 1); /* make sure it has the correct type set (g_m1_type_1, no negset, no flags) */ types[0] = "g_b_type_2"; /* added in base when declared */ types[1] = "g_m1_type_1"; /* added in module */