Report information
The Basics
Id:
47061
Status:
resolved
Priority:
Low/Low
Queue:

People
Requestors:
Cc:
AdminCc:

BugTracker
Version Fixed:
(no value)
Version Found:
(no value)
Versions Affected:
(no value)
Versions Planned:
(no value)
Priority:
(no value)
Severity:
(no value)
CVSS Score:
(no value)
CVE ID:
(no value)
Component:
(no value)
Area:
feature

Dates
Created:Thu, 25 Jan 2018 15:52:56 -0500
Updated:Tue, 30 Jan 2018 13:34:47 -0500
Closed:Tue, 30 Jan 2018 13:34:47 -0500



This bug tracker is no longer active.

Please go to our Gitlab to submit issues (both feature requests and bug reports) for active projects maintained by Internet Systems Consortium (ISC).

Due to security and confidentiality requirements, full access is limited to the primary maintainers.

From: ckb@isc.org
To: bind9-public@isc.org
Subject: unittest.sh fails to run on openBSD
Date: Thu, 25 Jan 2018 12:52:56 -0800
the 'type' command produces different output on openBSD than on other platforms, leading the script to always behave as if the 'kyua' binary in on the PATH. we can fix this by using 'command -v' instead of 'type'
diff --git a/unit/unittest.sh.in b/unit/unittest.sh.in old mode 100644 new mode 100755 index de304c641d..2ddbdb7703 --- a/unit/unittest.sh.in +++ b/unit/unittest.sh.in @@ -2,8 +2,8 @@ PATH="@ATFBIN@:${PATH}" export PATH -ATFRUN=`type atf-run 2>/dev/null | awk '{print $3}'` -KYUA=`type kyua 2>/dev/null | awk '{print $3}'` +ATFRUN=`command -v atf-run 2>/dev/null` +KYUA=`command -v kyua 2>/dev/null` status=0 if [ -n "@UNITTESTS@" -a -x "$ATFRUN" -a -f Atffile ]
To: bind9-public@isc.org
From: "Mark Andrews" <marka@isc.org>
Subject: Re: [ISC-Bugs #47061] unittest.sh fails to run on openBSD
Date: Fri, 26 Jan 2018 10:35:17 +1100
Command isn’t portable. type atf-run && ATF-RUN=atf-run with error redirect should work. -- Mark Andrews > On 26 Jan 2018, at 08:27, Curtis Blackburn via RT <bind9-public@isc.org> wrote: > > diff --git a/unit/unittest.sh.in b/unit/unittest.sh.in > old mode 100644 > new mode 100755 > index de304c641d..2ddbdb7703 > --- a/unit/unittest.sh.in > +++ b/unit/unittest.sh.in > @@ -2,8 +2,8 @@ > > PATH="@ATFBIN@:${PATH}" > export PATH > -ATFRUN=`type atf-run 2>/dev/null | awk '{print $3}'` > -KYUA=`type kyua 2>/dev/null | awk '{print $3}'` > +ATFRUN=`command -v atf-run 2>/dev/null` > +KYUA=`command -v kyua 2>/dev/null` > > status=0 > if [ -n "@UNITTESTS@" -a -x "$ATFRUN" -a -f Atffile ] > > -- > Ticket History: https://bugs.isc.org/Ticket/Display.html?id=47061
On Sat Jan 27 15:33:26 2018, ckb wrote: > type isnt portable, and fails to produce the output needed on openbsd. > command -v runs on every single system in the lab (and the ones I have > at home). > > On Thu Jan 25 15:35:24 2018, marka wrote: > > Command isn’t portable. > > > > > > type atf-run && ATF-RUN=atf-run > > > > with error redirect should work. > > type (posix issue 2) predates command (posix issue 4). We just have to test for the existence of the commands (exit status). We don't have to extract the path (which is where the issue is). The above said "if atf-run exists then set ATFRUN to atf-run" (corrected variable name). We could also only do this if ATFRUN was not set.
On the one hand, there do exist systems that have type and don't have command. On the other hand, none of those systems are in use in our test lab, whereas there are systems in our test lab that implement type idiosyncratically. Furthermore, in the event that anyone needs to run ATF unit tests on a system that's too old to have command, workarounds probably exist such as SHELL=/bin/bash. I suggest rather than spending further developer time on this, let's just merge it. We can tidy it up later if it turns out to be necessary.
On Mon Jan 29 09:45:31 2018, each wrote: > On the one hand, there do exist systems that have type and don't have > command. > > On the other hand, none of those systems are in use in our test lab, > whereas > there are systems in our test lab that implement type > idiosyncratically. > Furthermore, in the event that anyone needs to run ATF unit tests on a > system > that's too old to have command, workarounds probably exist such as > SHELL=/bin/bash. > > I suggest rather than spending further developer time on this, let's > just merge it. We can tidy it up later if it turns out to be > necessary. The branch or the patch?
CC:
Subject: Re: [ISC-Bugs #47061] unittest.sh fails to run on openBSD
Date: Tue, 30 Jan 2018 02:26:24 +0000
From: "Evan Hunt" <each@isc.org>
To: "Mark Andrews via RT" <bind9-public@isc.org>
> The branch or the patch? I meant the thing Curtis posted.
I put a merge request for it into gitlab.