From patchwork Thu Feb 8 23:02:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: DJ Delorie X-Patchwork-Id: 871152 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-90160-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="c0X7RCot"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zcty00bbjz9s4q for ; Fri, 9 Feb 2018 10:02:31 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:message-id:from:to:subject; q=dns; s= default; b=T8DL2Kh8AZ3RpWSnBV2R/D3zoUlowdq8Zgm2KureO5tOZjd+uxhCb QHTLQixaeAaLoJZqGmtBaIYinlkCBMmx9S+nxWNykzHLSiyyd8NZJ3NYHN576cW7 t3BRcJSxQe1hfhdi0mxHsKS/D3BcAC2fqGyVP9oa0CgVo3TrHIPP6s= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:message-id:from:to:subject; s=default; bh=FtgUO/nziXNQcsqhBSzsxrppHz4=; b=c0X7RCotv4tWSCYlABUof0sS1Ist Cup87SqKPkJMYY4gBXK+Ukfv2Q14d8nkjFX1Fm4RjAYNpMA4v0+qoUxX+rJaXBZ1 //WtWOiOnMzsiLsVMgNsQw6p+HdSP11y/TdwtJU2EXe17of9o9Q0OWo1/NTxvNKp Lwi8IEKHFyvDZUY= Received: (qmail 90513 invoked by alias); 8 Feb 2018 23:02:26 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 90443 invoked by uid 89); 8 Feb 2018 23:02:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Hx-languages-length:1607, nsswitchconf, nsswitch.conf, UD:nsswitch.conf X-HELO: mx1.redhat.com Date: Thu, 08 Feb 2018 18:02:21 -0500 Message-Id: From: DJ Delorie To: libc-alpha@sourceware.org Subject: RFC [2/2] test-in-container example diff --git a/nss/Makefile b/nss/Makefile index a5cd2aacae..60a28a1519 100644 --- a/nss/Makefile +++ b/nss/Makefile @@ -55,11 +55,13 @@ tests-internal = tst-field tests = test-netdb test-digits-dots tst-nss-getpwent bug17079 \ tst-nss-test1 \ tst-nss-test2 \ - tst-nss-test3 \ tst-nss-test4 \ tst-nss-test5 xtests = bug-erange +tests-container = \ + tst-nss-test3 + # Tests which need libdl ifeq (yes,$(build-shared)) tests += tst-nss-files-hosts-erange diff --git a/nss/tst-nss-test3.c b/nss/tst-nss-test3.c index d9d708ae7b..4112231778 100644 --- a/nss/tst-nss-test3.c +++ b/nss/tst-nss-test3.c @@ -107,7 +107,11 @@ do_test (void) int i; struct group *g = NULL; - __nss_configure_lookup ("group", "test1"); +/* Previously we used __nss_configure_lookup to isolate the test + from the host environment and to get it to lookup from our new + test1 NSS service module, but now this test is run in a different + root filesystem via the test-container support and we directly + configure the use of the test1 NSS service. */ setgrent (); diff --git a/nss/tst-nss-test3.root/etc/nsswitch.conf b/nss/tst-nss-test3.root/etc/nsswitch.conf new file mode 100644 index 0000000000..5e08fe5eea --- /dev/null +++ b/nss/tst-nss-test3.root/etc/nsswitch.conf @@ -0,0 +1 @@ +group test1 diff --git a/nss/tst-nss-test3.root/files.txt b/nss/tst-nss-test3.root/files.txt new file mode 100644 index 0000000000..a10beb1e6c --- /dev/null +++ b/nss/tst-nss-test3.root/files.txt @@ -0,0 +1,2 @@ +cp $B/nss/libnss_test1.so $L/libnss_test1.so.2 +cp $B/nss/libnss_test2.so $L/libnss_test2.so.2