* [PATCH] tests/check-block: Do not run the iotests with old versions of bash @ 2020-09-12 12:14 Thomas Huth 2020-09-14 9:19 ` Max Reitz ` (2 more replies) 0 siblings, 3 replies; 10+ messages in thread From: Thomas Huth @ 2020-09-12 12:14 UTC (permalink / raw) To: qemu-devel, Max Reitz; +Cc: Daniel P . Berrangé, qemu-block macOS is shipped with a very old version of the bash (3.2), which is currently not suitable for running the iotests anymore. Add a check to skip the iotests in this case - if someone still wants to run the iotests on macOS, they can install a newer version from homebrew, for example. Signed-off-by: Thomas Huth <thuth@redhat.com> --- tests/check-block.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/check-block.sh b/tests/check-block.sh index 8e29c868e5..bfe1630c1e 100755 --- a/tests/check-block.sh +++ b/tests/check-block.sh @@ -46,6 +46,11 @@ if ! command -v bash >/dev/null 2>&1 ; then exit 0 fi +if bash --version | grep 'GNU bash, version [123]' > /dev/null 2>&1 ; then + echo "bash version too old ==> Not running the qemu-iotests." + exit 0 +fi + if ! (sed --version | grep 'GNU sed') > /dev/null 2>&1 ; then if ! command -v gsed >/dev/null 2>&1; then echo "GNU sed not available ==> Not running the qemu-iotests." -- 2.18.2 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH] tests/check-block: Do not run the iotests with old versions of bash 2020-09-12 12:14 [PATCH] tests/check-block: Do not run the iotests with old versions of bash Thomas Huth @ 2020-09-14 9:19 ` Max Reitz 2020-09-14 10:50 ` Thomas Huth 2020-09-14 9:36 ` 罗勇刚(Yonggang Luo) 2020-09-14 15:03 ` Eric Blake 2 siblings, 1 reply; 10+ messages in thread From: Max Reitz @ 2020-09-14 9:19 UTC (permalink / raw) To: Thomas Huth, qemu-devel; +Cc: Daniel P . Berrangé, qemu-block [-- Attachment #1.1: Type: text/plain, Size: 1393 bytes --] On 12.09.20 14:14, Thomas Huth wrote: > macOS is shipped with a very old version of the bash (3.2), which > is currently not suitable for running the iotests anymore. Add > a check to skip the iotests in this case - if someone still wants > to run the iotests on macOS, they can install a newer version from > homebrew, for example. > > Signed-off-by: Thomas Huth <thuth@redhat.com> > --- > tests/check-block.sh | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/tests/check-block.sh b/tests/check-block.sh > index 8e29c868e5..bfe1630c1e 100755 > --- a/tests/check-block.sh > +++ b/tests/check-block.sh > @@ -46,6 +46,11 @@ if ! command -v bash >/dev/null 2>&1 ; then > exit 0 > fi > > +if bash --version | grep 'GNU bash, version [123]' > /dev/null 2>&1 ; then grep -q instead of the redirections, perhaps? But more importantly, I think this needs a LANG=C prefix. (If I expand the rejected major versions to [12345], it doesn’t skip without a prefix, because the string reads “GNU bash, Version 5...” here in LANG=de_DE.UTF-8.) Max > + echo "bash version too old ==> Not running the qemu-iotests." > + exit 0 > +fi > + > if ! (sed --version | grep 'GNU sed') > /dev/null 2>&1 ; then > if ! command -v gsed >/dev/null 2>&1; then > echo "GNU sed not available ==> Not running the qemu-iotests." > [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] tests/check-block: Do not run the iotests with old versions of bash 2020-09-14 9:19 ` Max Reitz @ 2020-09-14 10:50 ` Thomas Huth 2020-09-14 11:13 ` Max Reitz 0 siblings, 1 reply; 10+ messages in thread From: Thomas Huth @ 2020-09-14 10:50 UTC (permalink / raw) To: Max Reitz, qemu-devel; +Cc: Daniel P . Berrangé, qemu-block On 14/09/2020 11.19, Max Reitz wrote: > On 12.09.20 14:14, Thomas Huth wrote: >> macOS is shipped with a very old version of the bash (3.2), which >> is currently not suitable for running the iotests anymore. Add >> a check to skip the iotests in this case - if someone still wants >> to run the iotests on macOS, they can install a newer version from >> homebrew, for example. >> >> Signed-off-by: Thomas Huth <thuth@redhat.com> >> --- >> tests/check-block.sh | 5 +++++ >> 1 file changed, 5 insertions(+) >> >> diff --git a/tests/check-block.sh b/tests/check-block.sh >> index 8e29c868e5..bfe1630c1e 100755 >> --- a/tests/check-block.sh >> +++ b/tests/check-block.sh >> @@ -46,6 +46,11 @@ if ! command -v bash >/dev/null 2>&1 ; then >> exit 0 >> fi >> >> +if bash --version | grep 'GNU bash, version [123]' > /dev/null 2>&1 ; then > > grep -q instead of the redirections, perhaps? > > But more importantly, I think this needs a LANG=C prefix. (If I expand > the rejected major versions to [12345], it doesn’t skip without a > prefix, because the string reads “GNU bash, Version 5...” here in > LANG=de_DE.UTF-8.) Ouch, ok. But actually, I'm not quite sure anymore whether the patch is really required. I ran into the "readlink -f" problem and thought that it occurred due to the ancient version of bash on macOS, but as a I now know, readlink is a separate program and not a bash built-in, so it's a different issue... thus let's skip this patch here for now until we hit a real issue with bash again. Thomas ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] tests/check-block: Do not run the iotests with old versions of bash 2020-09-14 10:50 ` Thomas Huth @ 2020-09-14 11:13 ` Max Reitz 2020-09-14 11:21 ` Thomas Huth 0 siblings, 1 reply; 10+ messages in thread From: Max Reitz @ 2020-09-14 11:13 UTC (permalink / raw) To: Thomas Huth, qemu-devel; +Cc: Daniel P . Berrangé, qemu-block [-- Attachment #1.1: Type: text/plain, Size: 1960 bytes --] On 14.09.20 12:50, Thomas Huth wrote: > On 14/09/2020 11.19, Max Reitz wrote: >> On 12.09.20 14:14, Thomas Huth wrote: >>> macOS is shipped with a very old version of the bash (3.2), which >>> is currently not suitable for running the iotests anymore. Add >>> a check to skip the iotests in this case - if someone still wants >>> to run the iotests on macOS, they can install a newer version from >>> homebrew, for example. >>> >>> Signed-off-by: Thomas Huth <thuth@redhat.com> >>> --- >>> tests/check-block.sh | 5 +++++ >>> 1 file changed, 5 insertions(+) >>> >>> diff --git a/tests/check-block.sh b/tests/check-block.sh >>> index 8e29c868e5..bfe1630c1e 100755 >>> --- a/tests/check-block.sh >>> +++ b/tests/check-block.sh >>> @@ -46,6 +46,11 @@ if ! command -v bash >/dev/null 2>&1 ; then >>> exit 0 >>> fi >>> >>> +if bash --version | grep 'GNU bash, version [123]' > /dev/null 2>&1 ; then >> >> grep -q instead of the redirections, perhaps? >> >> But more importantly, I think this needs a LANG=C prefix. (If I expand >> the rejected major versions to [12345], it doesn’t skip without a >> prefix, because the string reads “GNU bash, Version 5...” here in >> LANG=de_DE.UTF-8.) > > Ouch, ok. But actually, I'm not quite sure anymore whether the patch is > really required. I ran into the "readlink -f" problem and thought that > it occurred due to the ancient version of bash on macOS, but as a I now > know, readlink is a separate program and not a bash built-in, so it's a > different issue... thus let's skip this patch here for now until we hit > a real issue with bash again. Yes, I had hoped this patch would fix that issue. Or perhaps at least hide it, because if you have a newer bash, chances are your readlink has -f, too. So should we just effectively revert b1cbc33a397 if readlink -f didn’t work, i.e. check "$?" and on failure use $PWD as it was before b1cbc33a397? Max [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] tests/check-block: Do not run the iotests with old versions of bash 2020-09-14 11:13 ` Max Reitz @ 2020-09-14 11:21 ` Thomas Huth 0 siblings, 0 replies; 10+ messages in thread From: Thomas Huth @ 2020-09-14 11:21 UTC (permalink / raw) To: Max Reitz, qemu-devel; +Cc: Daniel P . Berrangé, qemu-block On 14/09/2020 13.13, Max Reitz wrote: > On 14.09.20 12:50, Thomas Huth wrote: >> On 14/09/2020 11.19, Max Reitz wrote: >>> On 12.09.20 14:14, Thomas Huth wrote: >>>> macOS is shipped with a very old version of the bash (3.2), which >>>> is currently not suitable for running the iotests anymore. Add >>>> a check to skip the iotests in this case - if someone still wants >>>> to run the iotests on macOS, they can install a newer version from >>>> homebrew, for example. >>>> >>>> Signed-off-by: Thomas Huth <thuth@redhat.com> >>>> --- >>>> tests/check-block.sh | 5 +++++ >>>> 1 file changed, 5 insertions(+) >>>> >>>> diff --git a/tests/check-block.sh b/tests/check-block.sh >>>> index 8e29c868e5..bfe1630c1e 100755 >>>> --- a/tests/check-block.sh >>>> +++ b/tests/check-block.sh >>>> @@ -46,6 +46,11 @@ if ! command -v bash >/dev/null 2>&1 ; then >>>> exit 0 >>>> fi >>>> >>>> +if bash --version | grep 'GNU bash, version [123]' > /dev/null 2>&1 ; then >>> >>> grep -q instead of the redirections, perhaps? >>> >>> But more importantly, I think this needs a LANG=C prefix. (If I expand >>> the rejected major versions to [12345], it doesn’t skip without a >>> prefix, because the string reads “GNU bash, Version 5...” here in >>> LANG=de_DE.UTF-8.) >> >> Ouch, ok. But actually, I'm not quite sure anymore whether the patch is >> really required. I ran into the "readlink -f" problem and thought that >> it occurred due to the ancient version of bash on macOS, but as a I now >> know, readlink is a separate program and not a bash built-in, so it's a >> different issue... thus let's skip this patch here for now until we hit >> a real issue with bash again. > > Yes, I had hoped this patch would fix that issue. Or perhaps at least > hide it, because if you have a newer bash, chances are your readlink has > -f, too. > > So should we just effectively revert b1cbc33a397 if readlink -f didn’t > work, i.e. check "$?" and on failure use $PWD as it was before b1cbc33a397? Sounds like the best option that I currently can see, indeed. Want me to send a patch, or will you provide one? Thomas ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] tests/check-block: Do not run the iotests with old versions of bash 2020-09-12 12:14 [PATCH] tests/check-block: Do not run the iotests with old versions of bash Thomas Huth 2020-09-14 9:19 ` Max Reitz @ 2020-09-14 9:36 ` 罗勇刚(Yonggang Luo) 2020-09-14 10:45 ` Thomas Huth 2020-09-14 15:03 ` Eric Blake 2 siblings, 1 reply; 10+ messages in thread From: 罗勇刚(Yonggang Luo) @ 2020-09-14 9:36 UTC (permalink / raw) To: Thomas Huth; +Cc: Daniel P . Berrangé, qemu-level, Qemu-block, Max Reitz [-- Attachment #1: Type: text/plain, Size: 1339 bytes --] On Sat, Sep 12, 2020 at 8:16 PM Thomas Huth <thuth@redhat.com> wrote: > > macOS is shipped with a very old version of the bash (3.2), which > is currently not suitable for running the iotests anymore. Add > a check to skip the iotests in this case - if someone still wants > to run the iotests on macOS, they can install a newer version from > homebrew, for example. > > Signed-off-by: Thomas Huth <thuth@redhat.com> > --- > tests/check-block.sh | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/tests/check-block.sh b/tests/check-block.sh > index 8e29c868e5..bfe1630c1e 100755 > --- a/tests/check-block.sh > +++ b/tests/check-block.sh > @@ -46,6 +46,11 @@ if ! command -v bash >/dev/null 2>&1 ; then > exit 0 > fi > > +if bash --version | grep 'GNU bash, version [123]' > /dev/null 2>&1 ; then > + echo "bash version too old ==> Not running the qemu-iotests." > + exit 0 > +fi > + > if ! (sed --version | grep 'GNU sed') > /dev/null 2>&1 ; then > if ! command -v gsed >/dev/null 2>&1; then > echo "GNU sed not available ==> Not running the qemu-iotests." > -- > 2.18.2 > > Is that worth to convert the check-block.sh script to python script? so it can even running under msys2/mingw? -- 此致 礼 罗勇刚 Yours sincerely, Yonggang Luo [-- Attachment #2: Type: text/html, Size: 1740 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] tests/check-block: Do not run the iotests with old versions of bash 2020-09-14 9:36 ` 罗勇刚(Yonggang Luo) @ 2020-09-14 10:45 ` Thomas Huth 0 siblings, 0 replies; 10+ messages in thread From: Thomas Huth @ 2020-09-14 10:45 UTC (permalink / raw) To: luoyonggang; +Cc: Daniel P . Berrangé, qemu-level, Qemu-block, Max Reitz On 14/09/2020 11.36, 罗勇刚(Yonggang Luo) wrote: > > > On Sat, Sep 12, 2020 at 8:16 PM Thomas Huth <thuth@redhat.com > <mailto:thuth@redhat.com>> wrote: >> >> macOS is shipped with a very old version of the bash (3.2), which >> is currently not suitable for running the iotests anymore. Add >> a check to skip the iotests in this case - if someone still wants >> to run the iotests on macOS, they can install a newer version from >> homebrew, for example. >> >> Signed-off-by: Thomas Huth <thuth@redhat.com <mailto:thuth@redhat.com>> >> --- >> tests/check-block.sh | 5 +++++ >> 1 file changed, 5 insertions(+) >> >> diff --git a/tests/check-block.sh b/tests/check-block.sh >> index 8e29c868e5..bfe1630c1e 100755 >> --- a/tests/check-block.sh >> +++ b/tests/check-block.sh >> @@ -46,6 +46,11 @@ if ! command -v bash >/dev/null 2>&1 ; then >> exit 0 >> fi >> >> +if bash --version | grep 'GNU bash, version [123]' > /dev/null 2>&1 ; > then >> + echo "bash version too old ==> Not running the qemu-iotests." >> + exit 0 >> +fi >> + >> if ! (sed --version | grep 'GNU sed') > /dev/null 2>&1 ; then >> if ! command -v gsed >/dev/null 2>&1; then >> echo "GNU sed not available ==> Not running the qemu-iotests." >> -- >> 2.18.2 >> >> > Is that worth to convert the check-block.sh script to python script? so > it can even running under msys2/mingw? No, you need bash for the various iotest anyway. Thomas ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] tests/check-block: Do not run the iotests with old versions of bash 2020-09-12 12:14 [PATCH] tests/check-block: Do not run the iotests with old versions of bash Thomas Huth 2020-09-14 9:19 ` Max Reitz 2020-09-14 9:36 ` 罗勇刚(Yonggang Luo) @ 2020-09-14 15:03 ` Eric Blake 2020-09-14 15:33 ` Thomas Huth 2 siblings, 1 reply; 10+ messages in thread From: Eric Blake @ 2020-09-14 15:03 UTC (permalink / raw) To: Thomas Huth, qemu-devel, Max Reitz; +Cc: Daniel P . Berrangé, qemu-block On 9/12/20 7:14 AM, Thomas Huth wrote: > macOS is shipped with a very old version of the bash (3.2), which > is currently not suitable for running the iotests anymore. Add > a check to skip the iotests in this case - if someone still wants > to run the iotests on macOS, they can install a newer version from > homebrew, for example. > > Signed-off-by: Thomas Huth <thuth@redhat.com> > --- > tests/check-block.sh | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/tests/check-block.sh b/tests/check-block.sh > index 8e29c868e5..bfe1630c1e 100755 > --- a/tests/check-block.sh > +++ b/tests/check-block.sh > @@ -46,6 +46,11 @@ if ! command -v bash >/dev/null 2>&1 ; then > exit 0 > fi > > +if bash --version | grep 'GNU bash, version [123]' > /dev/null 2>&1 ; then We're already running bash - why do we need to spawn another bash and a grep, when we can just check $BASH_VERSION? -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] tests/check-block: Do not run the iotests with old versions of bash 2020-09-14 15:03 ` Eric Blake @ 2020-09-14 15:33 ` Thomas Huth 2020-09-14 16:01 ` Eric Blake 0 siblings, 1 reply; 10+ messages in thread From: Thomas Huth @ 2020-09-14 15:33 UTC (permalink / raw) To: Eric Blake, qemu-devel, Max Reitz; +Cc: Daniel P . Berrangé, qemu-block On 14/09/2020 17.03, Eric Blake wrote: > On 9/12/20 7:14 AM, Thomas Huth wrote: >> macOS is shipped with a very old version of the bash (3.2), which >> is currently not suitable for running the iotests anymore. Add >> a check to skip the iotests in this case - if someone still wants >> to run the iotests on macOS, they can install a newer version from >> homebrew, for example. >> >> Signed-off-by: Thomas Huth <thuth@redhat.com> >> --- >> tests/check-block.sh | 5 +++++ >> 1 file changed, 5 insertions(+) >> >> diff --git a/tests/check-block.sh b/tests/check-block.sh >> index 8e29c868e5..bfe1630c1e 100755 >> --- a/tests/check-block.sh >> +++ b/tests/check-block.sh >> @@ -46,6 +46,11 @@ if ! command -v bash >/dev/null 2>&1 ; then >> exit 0 >> fi >> +if bash --version | grep 'GNU bash, version [123]' > /dev/null 2>&1 >> ; then > > We're already running bash - why do we need to spawn another bash and a > grep, when we can just check $BASH_VERSION? tests/check-block.sh uses "#!/bin/sh", so it could be running with a different kind of shell, I think. Thomas ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] tests/check-block: Do not run the iotests with old versions of bash 2020-09-14 15:33 ` Thomas Huth @ 2020-09-14 16:01 ` Eric Blake 0 siblings, 0 replies; 10+ messages in thread From: Eric Blake @ 2020-09-14 16:01 UTC (permalink / raw) To: Thomas Huth, qemu-devel, Max Reitz; +Cc: Daniel P . Berrangé, qemu-block On 9/14/20 10:33 AM, Thomas Huth wrote: > On 14/09/2020 17.03, Eric Blake wrote: >> On 9/12/20 7:14 AM, Thomas Huth wrote: >>> macOS is shipped with a very old version of the bash (3.2), which >>> is currently not suitable for running the iotests anymore. Add >>> a check to skip the iotests in this case - if someone still wants >>> to run the iotests on macOS, they can install a newer version from >>> homebrew, for example. >>> >>> Signed-off-by: Thomas Huth <thuth@redhat.com> >>> --- >>> tests/check-block.sh | 5 +++++ >>> 1 file changed, 5 insertions(+) >>> >>> diff --git a/tests/check-block.sh b/tests/check-block.sh >>> index 8e29c868e5..bfe1630c1e 100755 >>> --- a/tests/check-block.sh >>> +++ b/tests/check-block.sh >>> @@ -46,6 +46,11 @@ if ! command -v bash >/dev/null 2>&1 ; then >>> exit 0 >>> fi >>> +if bash --version | grep 'GNU bash, version [123]' > /dev/null 2>&1 >>> ; then >> >> We're already running bash - why do we need to spawn another bash and a >> grep, when we can just check $BASH_VERSION? > > tests/check-block.sh uses "#!/bin/sh", so it could be running with a > different kind of shell, I think. Ah, right; I'm so used to most of our testsuite demanding bash that I forgot to check that this script sticks to the smaller subset of /bin/sh portability. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2020-09-14 17:12 UTC | newest] Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2020-09-12 12:14 [PATCH] tests/check-block: Do not run the iotests with old versions of bash Thomas Huth 2020-09-14 9:19 ` Max Reitz 2020-09-14 10:50 ` Thomas Huth 2020-09-14 11:13 ` Max Reitz 2020-09-14 11:21 ` Thomas Huth 2020-09-14 9:36 ` 罗勇刚(Yonggang Luo) 2020-09-14 10:45 ` Thomas Huth 2020-09-14 15:03 ` Eric Blake 2020-09-14 15:33 ` Thomas Huth 2020-09-14 16:01 ` Eric Blake
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.