[DTrace-devel] [PATCH v2 2/4] test: fix check_result.sh

Eugene Loh eugene.loh at oracle.com
Thu Nov 2 17:12:33 UTC 2023


On 11/2/23 09:13, Nick Alcock wrote:

> On 1 Nov 2023, Eugene Loh via DTrace-devel uttered the following:
>> I don't argue with the patch, but for my personal edification I'd like
>> to understand the commit message better.  The pre-existing syntax
>> seemed to have worked perfectly for me and I don't ever remember
>> encountering the problem described.  Ah well.  The patch is fine
>> regardless.
> You don't get any actual runtest-visible error when this happens; the
> tests don't fail, you just get a syntax error on stderr, and tests don't
> fail that perhaps should have done. You need to look in the runtest.log
> to see it.
>
> It might be specific to some versions of bash or something, though I'd
> be rather surprised if it was. This was on OL9, with bash 5.1.8.

Interesting, thanks.  I guess I'll just accept this as some mystery I 
don't understand and don't need to.  FWIW:

$ cat /etc/oracle-release
Oracle Linux Server release 9.0
$ bash --version
GNU bash, version 5.1.8(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ cat z
#!/bin/bash

expect=10
margin=2
for actual in 6 7 8 9 10 11 12 13 14; do
     printf " check %10s;  against %10s;  margin %10s:  " $actual 
$expect $margin
     if [ $actual -lt $(($expect - $margin)) ]; then
         echo ERROR too small
     elif [ $actual -gt $(($expect + $margin)) ]; then
         echo ERROR too large
     else
         echo
     fi
done
$ ./z
  check          6;  against         10;  margin          2:  ERROR too 
small
  check          7;  against         10;  margin          2:  ERROR too 
small
  check          8;  against         10;  margin          2:
  check          9;  against         10;  margin          2:
  check         10;  against         10;  margin          2:
  check         11;  against         10;  margin          2:
  check         12;  against         10;  margin          2:
  check         13;  against         10;  margin          2:  ERROR too 
large
  check         14;  against         10;  margin          2:  ERROR too 
large




More information about the DTrace-devel mailing list