Thread (1 message) 1 message, 1 author, 2012-03-21

Re: [PATCH] fdtget-runtest.sh: Fix failures when /bin/sh isn't bash

From: David Gibson <hidden>
Date: 2012-03-21 03:26:53

On Tue, Mar 20, 2012 at 08:23:46PM -0600, Stephen Warren wrote:
On Ubuntu, /bin/sh is dash (at least by default), and dash's echo doesn't
accept the -e option. This means that fdtget-runtest.sh's EXPECT file will
contain "-e foo" rather than just "foo", which causes a test failure.

To work around this, run /bin/echo instead of (builtin) echo, which has
more chance of supporting the -e option.

Another possible fix is to change all the #! lines to /bin/bash rather
than /bin/sh, and change run_tests.sh to invoke sub-scripts using $SHELL
instead of just "sh". However, that would require bash specifically, which
may not be desirable.

Signed-off-by: Stephen Warren <redacted>
Acked-by: David Gibson <redacted>

Jon, please apply.

I don't think this fix is perfect - for example, I wonder what will
happen if /bin/echo is actually a busybox instance.  But it's
definitely better than right now, where the testsuite will give
failures out of the box on the default setup for several major
distros.

And as Stephen suggests, I would prefer not to make the test scripts
bash specific.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help