From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58093) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ffN7d-00085v-Mx for qemu-devel@nongnu.org; Tue, 17 Jul 2018 06:22:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ffN7a-0004PL-GM for qemu-devel@nongnu.org; Tue, 17 Jul 2018 06:22:21 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:35159) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ffN7a-0004Ow-7f for qemu-devel@nongnu.org; Tue, 17 Jul 2018 06:22:18 -0400 Received: by mail-wr1-x442.google.com with SMTP id a3-v6so697349wrt.2 for ; Tue, 17 Jul 2018 03:22:18 -0700 (PDT) References: <20180713121741.19262-1-alex.bennee@linaro.org> <20180713121741.19262-8-alex.bennee@linaro.org> <63c0e5cd-fac0-789c-d7fd-f77ed8d9d047@amsat.org> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <63c0e5cd-fac0-789c-d7fd-f77ed8d9d047@amsat.org> Date: Tue, 17 Jul 2018 11:22:15 +0100 Message-ID: <87601e5fhk.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 for 3.0 07/16] docker: gracefully skip check_qemu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Cc: cota@braap.org, famz@redhat.com, berrange@redhat.com, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de, qemu-devel@nongnu.org Philippe Mathieu-Daud=C3=A9 writes: > On 07/13/2018 09:17 AM, Alex Benn=C3=A9e wrote: >> Not all our images are able to run the tests. Rather than use features >> we can just check for the existence and run-ability of gtester. If the >> image has been setup for binfmt_misc it will be able to run anyway. >> >> Signed-off-by: Alex Benn=C3=A9e >> --- >> tests/docker/common.rc | 8 +++++++- >> 1 file changed, 7 insertions(+), 1 deletion(-) >> >> diff --git a/tests/docker/common.rc b/tests/docker/common.rc >> index cfc620d554..6df431eb72 100755 >> --- a/tests/docker/common.rc >> +++ b/tests/docker/common.rc >> @@ -47,7 +47,13 @@ check_qemu() >> else >> TEST=3D"$@" >> fi >> - make $MAKEFLAGS $TEST >> + >> + if type gtester > /dev/null 2>&1 && \ > > commit e465ce7d09939d631f1861e0bd8873417c1c0d65 > > tests: Use "command -v" instead of which(1) in shell scripts type is also a shell built-in albeit an 1982 bashism. I'll switch to command -v as tending towards POSIX is what we should aim for (although our test-FOO/common.rc structure seems a little confused). > > When which(1) is not installed, we would complain "perl not found" > because it's the first set_prog_path check. The error message is > wrong. > > Fix it by using "command -v", a native way to query the existence > of a command. > >> + gtester --version > /dev/null 2>&1; then >> + make $MAKEFLAGS $TEST >> + else >> + echo "No working gtester, skipping make $TEST" >> + fi >> } >> >> test_fail() >> -- Alex Benn=C3=A9e