On 11/19/18 10:08 PM, PiBa-NL wrote:
Hi Frederic, Willy,

Hi Pieter,

Thank you a lot again for this work Pieter.

Hello Pieter,

Do you intend to finalize this script? We would like to use it in haproxy sources. Note that varnishtest already uses TMPDIR variable in place of /tmp if it is set in the environment.

Thanks again.

Fred.

Thanks for your advices and comments, to be honest i haven't looked at the script for several days, got distracted by other things ;). So sorry for late reply.

No problem. Sorry for my late reply too ;)

Just cleaned it up a bit. I guess its ready for another review.

I still have a '
' newline, with the IFS= but the \n and \012 didnt seem to work there..

Strangely on my PC with both bash and dash I do not have to change
IFS value to parse HAPROXY_VERSION, TARGET and OPTIONS with "read"
internal command.

I've tried to incorporate all suggestions. Lemme know if/what i missed :)


I do not think it is a good idea to build TESTDIR like that:

   TESTRUNDATETIME="$(date '+%Y-%m-%d_%H-%M-%S')"

   TESTDIR=${TMPDIR:-/tmp}/varnishtest_haproxy/$TESTRUNDATETIME
   mkdir -p $TESTDIR

What if we run the tests several times at the same time?
Please have a look to mkstemp utility.


Remaining details:

    cat $i/LOG | grep -- ----

should be replaced by

    grep -- ---- $i/LOG


Note that you script is plenty of '\r' characters with no newline character at the end of file position:

$ sh run-regtests.sh
: not founds.sh: 2: run-regtests.sh:
run-regtests.sh: 58: run-regtests.sh: Syntax error: word unexpected (expecting "do")
flecaille@fl-haproxy:~/src/haproxy
$ bash -x run-regtests.sh
+ $'\r'
run-regtests.sh: line 2: $'\r': command not found
run-regtests.sh: line 47: syntax error near unexpected token `$'{\r''
'un-regtests.sh: line 47: `_startswith() {


Also note that some shells do not like == operator (at line 3):

$ HAPROXY_PROGRAM=~/src/haproxy/haproxy VARNISHTEST_PROGRAM=~/src/varnish-cache-trunk/bin/varnishtest/varnishtest sh run-regtests.sh
run-regtests.sh: 3: [: unexpected operator


When I do no set both HAPROY_PROGRAM I get this output with a script
with a successful result:

$ sh run-regtests.sh

########################## Preparing to run tests ##########################
run-regtests.sh.ok: 177: run-regtests.sh.ok: haproxy: not found
Testing with haproxy version:
run-regtests.sh.ok: 192: [: =: unexpected operator
run-regtests.sh.ok: 196: [: =: unexpected operator
run-regtests.sh.ok: 200: [: =: unexpected operator
run-regtests.sh.ok: 204: [: =: unexpected operator
run-regtests.sh.ok: 208: [: =: unexpected operator
run-regtests.sh.ok: 212: [: =: unexpected operator
run-regtests.sh.ok: 216: [: =: unexpected operator
run-regtests.sh.ok: 220: [: =: unexpected operator
run-regtests.sh.ok: 224: [: =: unexpected operator
run-regtests.sh.ok: 228: [: =: unexpected operator
run-regtests.sh.ok: 232: [: =: unexpected operator
run-regtests.sh.ok: 236: [: =: unexpected operator
run-regtests.sh.ok: 240: [: =: unexpected operator
run-regtests.sh.ok: 244: [: =: unexpected operator
run-regtests.sh.ok: 248: [: =: unexpected operator
Target :
Options :
########################## Gathering tests to run ##########################
  Skip ./h2-keepalive-backend.vtc because exclude_targets
    REASON: exclude_targets ',,' contains ''
  Skip ./urlp.regex.vtc because exclude_targets
    REASON: exclude_targets ',,' contains ''
  Skip ./reg-tests/ssl/b00000.vtc because exclude_targets
    REASON: exclude_targets ',,' contains ''
  Skip ./reg-tests/spoe/b00000.vtc because exclude_targets
    REASON: exclude_targets ',,' contains ''
  Skip ./reg-tests/log/b00000.vtc because exclude_targets
    REASON: exclude_targets ',,' contains ''
  Skip ./reg-tests/stick-table/b00001.vtc because exclude_targets
    REASON: exclude_targets ',,' contains ''
  Skip ./reg-tests/stick-table/b00000.vtc because exclude_targets
    REASON: exclude_targets ',,' contains ''
  Skip ./reg-tests/server/b00000.vtc because exclude_targets
    REASON: exclude_targets ',,' contains ''
  Skip ./reg-tests/seamless-reload/b00000.vtc because exclude_targets
    REASON: exclude_targets ',,' contains ''
  Skip ./reg-tests/connection/b00000.vtc because exclude_targets
    REASON: exclude_targets ',,' contains ''
  Skip ./reg-tests/lua/b00001.vtc because exclude_targets
    REASON: exclude_targets ',,' contains ''
  Skip ./reg-tests/lua/b00003.vtc because exclude_targets
    REASON: exclude_targets ',,' contains ''

$ echo $?
0



Regards.

Reply via email to