From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id BC81D2D8A4 for ; Tue, 27 Aug 2024 23:34:48 +0200 (CEST) Received: (qmail 21923 invoked by uid 550); 27 Aug 2024 21:34:44 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 21891 invoked from network); 27 Aug 2024 21:34:43 -0000 Date: Tue, 27 Aug 2024 17:34:36 -0400 From: Rich Felker To: Ryan Ward Cc: Szabolcs Nagy , "musl@lists.openwall.com" Message-ID: <20240827213435.GG10433@brightrain.aerifal.cx> References: <20240818093842.GD3766212@port70.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] Adding dns/resolver tests to libc-test On Tue, Aug 27, 2024 at 03:30:37PM +0000, Ryan Ward wrote: > Hello, > > I have made an attempt at fleshing out the resolver tests, please > see the file attached. It still needs some polishing, and I am keen > to keep building out the necessary tests, attached is a simple > rudimentary res_query() test.. I need to improve the packet and RR > parsing, but sending this out to get some early feedback before I > build out more tests. > > I have just been building the test and the unshare-ns.c framework > with the libc-test build system, executing unshare-ns.exe and > passing in resolv_query.exe as intended. My intent was that you call enter_dns_test_ns from the test process itself, not from a separate wrapper to exec it. This is so you don't end up having a program in the tests dir that, when executed independently as root, clobbers the host system's resolv.conf or hosts file (which would be really really bad). By entering the namespace in the same process and testing for error, you can bail out before doing anything if the namespace setup failed. This also avoids the need to add extra control machinery to run the tests. Rich