bash is installed in a different directory on non-Linux systems like
FreeBSD. Do not hard-code /bin/bash here so that the tests can run
there, too.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/qemu-iotests/239 | 2 +-
tests/qemu-iotests/240 | 2 +-
tests/qemu-iotests/241 | 2 +-
tests/qemu-iotests/243 | 2 +-
tests/qemu-iotests/244 | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/tests/qemu-iotests/239 b/tests/qemu-iotests/239
index 6f085d573d..b0991ffe59 100755
--- a/tests/qemu-iotests/239
+++ b/tests/qemu-iotests/239
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
# Test case for dmg
#
diff --git a/tests/qemu-iotests/240 b/tests/qemu-iotests/240
index 65cc3b39b1..d3e663ed65 100755
--- a/tests/qemu-iotests/240
+++ b/tests/qemu-iotests/240
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
# Test hot plugging and unplugging with iothreads
#
diff --git a/tests/qemu-iotests/241 b/tests/qemu-iotests/241
index 017a736aab..58b64ebf41 100755
--- a/tests/qemu-iotests/241
+++ b/tests/qemu-iotests/241
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
# Test qemu-nbd vs. unaligned images
#
diff --git a/tests/qemu-iotests/243 b/tests/qemu-iotests/243
index 5838c6e89c..e563761307 100755
--- a/tests/qemu-iotests/243
+++ b/tests/qemu-iotests/243
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
# Test qcow2 preallocation
#
diff --git a/tests/qemu-iotests/244 b/tests/qemu-iotests/244
index d8e7122305..13978f93d2 100755
--- a/tests/qemu-iotests/244
+++ b/tests/qemu-iotests/244
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
# Test qcow2 with external data files
#
--
2.21.0
On 4/24/19 5:37 AM, Thomas Huth wrote: > bash is installed in a different directory on non-Linux systems like > FreeBSD. Do not hard-code /bin/bash here so that the tests can run > there, too. These tests were obviously copy-and-pasted from a fork point prior to commit 11a82d14. Reviewed-by: Eric Blake <eblake@redhat.com> > > Signed-off-by: Thomas Huth <thuth@redhat.com> > --- > tests/qemu-iotests/239 | 2 +- > tests/qemu-iotests/240 | 2 +- > tests/qemu-iotests/241 | 2 +- > tests/qemu-iotests/243 | 2 +- > tests/qemu-iotests/244 | 2 +- > 5 files changed, 5 insertions(+), 5 deletions(-) -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
On 4/24/19 4:14 PM, Eric Blake wrote: > On 4/24/19 5:37 AM, Thomas Huth wrote: >> bash is installed in a different directory on non-Linux systems like >> FreeBSD. Do not hard-code /bin/bash here so that the tests can run >> there, too. > > These tests were obviously copy-and-pasted from a fork point prior to > commit 11a82d14. :( Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> > > Reviewed-by: Eric Blake <eblake@redhat.com> > >> >> Signed-off-by: Thomas Huth <thuth@redhat.com> >> --- >> tests/qemu-iotests/239 | 2 +- >> tests/qemu-iotests/240 | 2 +- >> tests/qemu-iotests/241 | 2 +- >> tests/qemu-iotests/243 | 2 +- >> tests/qemu-iotests/244 | 2 +- >> 5 files changed, 5 insertions(+), 5 deletions(-) > >
On Wed, Apr 24, 2019 at 09:14:29AM -0500, Eric Blake wrote: > On 4/24/19 5:37 AM, Thomas Huth wrote: > > bash is installed in a different directory on non-Linux systems like > > FreeBSD. Do not hard-code /bin/bash here so that the tests can run > > there, too. > > These tests were obviously copy-and-pasted from a fork point prior to > commit 11a82d14. Is this a candidate for a checkpatch addition to reject any use of /bin/bash in scripts ? Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
On 24/04/2019 17.23, Daniel P. Berrangé wrote: > On Wed, Apr 24, 2019 at 09:14:29AM -0500, Eric Blake wrote: >> On 4/24/19 5:37 AM, Thomas Huth wrote: >>> bash is installed in a different directory on non-Linux systems like >>> FreeBSD. Do not hard-code /bin/bash here so that the tests can run >>> there, too. >> >> These tests were obviously copy-and-pasted from a fork point prior to >> commit 11a82d14. > > Is this a candidate for a checkpatch addition to reject any use > of /bin/bash in scripts ? Not sure whether we should really reject it with an error (there might be scripts that are only used on Linux anyway), but checkpatch.pl should at least print a warning, I think. Thomas
Thomas Huth <thuth@redhat.com> writes: > bash is installed in a different directory on non-Linux systems like > FreeBSD. Do not hard-code /bin/bash here so that the tests can run > there, too. > > Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> > --- > tests/qemu-iotests/239 | 2 +- > tests/qemu-iotests/240 | 2 +- > tests/qemu-iotests/241 | 2 +- > tests/qemu-iotests/243 | 2 +- > tests/qemu-iotests/244 | 2 +- > 5 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/tests/qemu-iotests/239 b/tests/qemu-iotests/239 > index 6f085d573d..b0991ffe59 100755 > --- a/tests/qemu-iotests/239 > +++ b/tests/qemu-iotests/239 > @@ -1,4 +1,4 @@ > -#!/bin/bash > +#!/usr/bin/env bash > # > # Test case for dmg > # > diff --git a/tests/qemu-iotests/240 b/tests/qemu-iotests/240 > index 65cc3b39b1..d3e663ed65 100755 > --- a/tests/qemu-iotests/240 > +++ b/tests/qemu-iotests/240 > @@ -1,4 +1,4 @@ > -#!/bin/bash > +#!/usr/bin/env bash > # > # Test hot plugging and unplugging with iothreads > # > diff --git a/tests/qemu-iotests/241 b/tests/qemu-iotests/241 > index 017a736aab..58b64ebf41 100755 > --- a/tests/qemu-iotests/241 > +++ b/tests/qemu-iotests/241 > @@ -1,4 +1,4 @@ > -#!/bin/bash > +#!/usr/bin/env bash > # > # Test qemu-nbd vs. unaligned images > # > diff --git a/tests/qemu-iotests/243 b/tests/qemu-iotests/243 > index 5838c6e89c..e563761307 100755 > --- a/tests/qemu-iotests/243 > +++ b/tests/qemu-iotests/243 > @@ -1,4 +1,4 @@ > -#!/bin/bash > +#!/usr/bin/env bash > # > # Test qcow2 preallocation > # > diff --git a/tests/qemu-iotests/244 b/tests/qemu-iotests/244 > index d8e7122305..13978f93d2 100755 > --- a/tests/qemu-iotests/244 > +++ b/tests/qemu-iotests/244 > @@ -1,4 +1,4 @@ > -#!/bin/bash > +#!/usr/bin/env bash > # > # Test qcow2 with external data files > # -- Alex Bennée
© 2016 - 2026 Red Hat, Inc.