From owner-freebsd-testing@freebsd.org Tue Aug 7 15:24:08 2018 Return-Path: Delivered-To: freebsd-testing@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA7201062002 for ; Tue, 7 Aug 2018 15:24:07 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6647C741B1; Tue, 7 Aug 2018 15:24:07 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pg1-x52b.google.com with SMTP id y5-v6so8018312pgv.1; Tue, 07 Aug 2018 08:24:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=30/n1eWTxYjKoFZ2NHURqhKa+Gy24I8QZcUJoV5dRFE=; b=AxHj0jW3Tr1ztyq/hhOtq8dST03IMKVgtPw3gQajfwUT2ufgc1/+ID/Rn2p/MDHPAz 1DnVlMFNvZxByEFmTfTaP/FD4H+5yn7lziYNixDSCrwz/9NjO0G1lC0n91F+m7rFKfd4 OP+vjzBbfok22DTRlxk9IPqx219hTKN0q6WRGYSkVY4Kfgs85tOOEK/J6Wx1cgNdGuZp 2edAb3pDKEtr2XLAoSp07birADZigCEAsSSTx/HTW5Ry4hAqNfO1TBgSpRaK4BomRFJ7 hLdqJdG3DTFWmOpDccF90pzxDU1afEOBLT6tHe4qVegK+pHa7bGj4sEfLAR5erun6IhY SHNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=30/n1eWTxYjKoFZ2NHURqhKa+Gy24I8QZcUJoV5dRFE=; b=ilsT5IBhVtRkSBmZLe9sVx1JL2vF6PlclWe+g2t4t4M2BWzoJvjBDSktsRqf9UwKx4 vsZg3/n1xonEB1ZR+M4mMmhFUuJuNZPBpf5cPDF7V7YGBoGSiZa6xXIyvn3qGJJeMfp+ vAdvIB8Z8QYboGRQBd3VN0LAfvGsMI6MhAu9O1DZybqJmue8PKiFX2d2lbXfM861N/DP iNUzM2PmrfhVKfYeI1s9j/HRPxYRS/Wm9brOdquC25voqr9d7WZyA0/iqMz32lgz82US agHK0VWVR2BoWS9Rh6tiEQxS8WAZBpauRsNNUU0VOXmVmYlBtS1cMIyv/tpGKAUwETgZ 1Ktg== X-Gm-Message-State: AOUpUlEdItSrrXLKlzxL829FlCfNYxhwIwsNBKsUyCCq6ZkPIY0KRV/T +GiU0odhLcl+8SbFUjmlZKM7wjG+ X-Google-Smtp-Source: AAOMgpeioyPmvo5wmgYDF/tm2PECEk1OwSc+j7uJzRHc6vQLrb+SR4K8i6oy0ekB3D8pR8uouNzQZg== X-Received: by 2002:a62:1647:: with SMTP id 68-v6mr22188096pfw.6.1533655445954; Tue, 07 Aug 2018 08:24:05 -0700 (PDT) Received: from raichu (toroon0560w-lp130-09-70-52-224-239.dsl.bell.ca. [70.52.224.239]) by smtp.gmail.com with ESMTPSA id s66-v6sm1906761pgc.67.2018.08.07.08.24.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Aug 2018 08:24:04 -0700 (PDT) Sender: Mark Johnston Date: Tue, 7 Aug 2018 11:24:02 -0400 From: Mark Johnston To: Alan Somers Cc: "freebsd-testing@freebsd.org" Subject: Re: Skipping tests that are unimplemented in 32-bit emulation Message-ID: <20180807152402.GG77150@raichu> References: <20180806191406.GA77150@raichu> <20180807150349.GF77150@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: freebsd-testing@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Testing on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 15:24:08 -0000 On Tue, Aug 07, 2018 at 09:08:39AM -0600, Alan Somers wrote: > On Tue, Aug 7, 2018 at 9:03 AM, Mark Johnston wrote: > > > On Mon, Aug 06, 2018 at 02:18:35PM -0600, Alan Somers wrote: > > > On Mon, Aug 6, 2018 at 1:14 PM, Mark Johnston wrote: > > > > > > > On Sun, Jul 29, 2018 at 11:23:33AM -0600, Alan Somers wrote: > > > > > I recently tried running the i386 test suite in a chroot on an amd64 > > > > > system. 162 tests failed, and 33 were broken. Some of the failures > > were > > > > > due to system calls that haven't been implemented in 32-bit > > emulation. > > > > > setfib(2) is an example. I think it's unlikely that anybody will > > ever > > > > need > > > > > 32-bit emulation for setfib(2), so perhaps we should just skip the > > test? > > > > > What's the best way to do that? I can come up with two ways: > > > > > > > > > > 1) At runtime, check the hw.machine sysctl and see if it matches some > > > > > compile time preprocessor constant. I don't know what constant to > > use, > > > > > though. Checking __amd64__ would only work for i386 binaries on > > amd64 > > > > > kernels, and not something else like mips binaries on mips64 kernels > > (I > > > > > don't know if we support that, but I don't want to rule it out). > > > > > > > > > > 2) At buildtime, put an "allowed_architectures=i386" metadata > > property > > > > into > > > > > the Kyuafile for that test program. This would require support in > > > > > /usr/share/mk/bsd.test.mk. It would also require patching Kyua > > itself, > > > > > because currently "Kyua config" returns the architecture for which > > it was > > > > > built, not the one on which it's running. > > > > > > > > > > Thoughts? > > > > > > > > I don't have any particular suggestions, but I'd personally rather > > avoid > > > > a solution that requires tests to opt-in to running under 32-bit > > > > emulation, which I think excludes 2). I'd be happy to help annotate > > > > any failing tests as required. It bugs me that the test suite > > currently > > > > doesn't cover such relatively complicated functions as > > > > freebsd32_copy_msg_out(). > > > > > > I don't think that 2 would necessarily be opt-in, because an undefined > > > value for allowed_architectures is interpreted as meaning "all". It > > could > > > be opt-out instead. But it could still be a little awkward. Option 1 > > > could be accomplished for atf-c testcases by comparing the value of > > > __LP64__ to a hardcoded list of known 64-bit processors as returned by > > > uname(3). But I don't know how to implement 1 for atf-sh programs. An > > > atf-sh program would need to know the architecture of any binary that it > > > might invoke. Is there anything in /etc indicating what architecture the > > > image was built for? Should we just use "file /lib/libc.so.*"? > > > > Could we instead build and install a /usr/tests32 suite on systems that > > can support it, and use a top-level Kyuafile and kyua.conf that overrides > > the "architecture" variable? > > > > It's not enough to build and install the atf-c tests in 32-bit mode. We > would need an entire 32-bit chroot in order to run the atf-sh tests in > 32-bit mode. Oops, right. For 2), then, couldn't we define test_suite("FreeBSD32") in the kyuafiles for the 32-bit test suite and set a test_suite.FreeBSD32.compat32=true variable in kyua.conf? Then a test which uses, say, setfib(1) can query that variable and skip if it's set.