On 11/23/18 1:12 AM, PiBa-NL wrote:
Hi Frederic,

Hi Pieter,

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.
Reading version,target and options works fine indeed without, however the loop over test files fails if any .vtc file has a space character in its filename. Or should we 'forbid' that with documentation.? Or is there another better workaround for that?

We will never use VTC files with spaces in their filenames.


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?
Well they would have to run at the same second. Not sure if that would be wise to do.. But mktemp now solved that i guess :) at least for the directory name part..
Please have a look to mkstemp utility.
Without the 's' right? Done, combined with the rundatetime which i do like, so its 'readable' and unique, best of both ways i think?.

Yes.

Remaining details:
    cat $i/LOG | grep -- ----
should be replaced by
    grep -- ---- $i/LOG
I guess ill never learn do do this right the first time around ;). Fixed.
Note that you script is plenty of '\r' characters with no newline character at the end of file position:
Not sure what the 'correct' way would be. I think there is a CR LF everywhere at the moment? And the scripts hashbang tries to point to 'sh', will this be a issue.? (acme.sh does the same, and seems to be run an lots of systems..) And if so what can i best do to avoid issues?

Yes there are \r\n characters in place of \n end of line character for each line.

You can check that with hexdump or od:

$ hexdump -c run-regtests.sh | head
0000000   #   !   /   u   s   r   /   b   i   n   /   e   n   v       s
0000010   h  \r  \n  \r  \n   i   f       [       "   $   1   "       =
0000020       "   -   -   h   e   l   p   "       ]   ;       t   h   e
0000030   n  \r  \n           c   a   t       <   <       E   O   F  \r
0000040  \n   #   #   #       r   u   n   -   r   e   g   t   e   s   t
0000050   s   .   s   h       #   #   #  \r  \n           R   u   n   n
0000060   i   n   g       r   u   n   -   r   e   g   t   e   s   t   s
0000070   .   s   h       -   -   h   e   l   p       s   h   o   w   s
0000080       t   h   i   s       i   n   f   o   r   m   a   t   i   o
0000090   n       a   b   o   u   t       h   o   w       t   o       u

There are chances you are using a text file editor on a non-Unix system?

You can remove them like that before

    cat run-regtests.sh | tr -d '\r' >run-regtests.sh.ok

Also note that some shells do not like == operator (at line 3):
Used a single = now.
When I do not set both HAPROY_PROGRAM I get this output with a script
with a successful result.

Checks added to avoid this issue for both haproxy and varnishtest so they are checked to exist.

Next round :).

Shoulb be the last ;)

Thanks a lot Pieter.

Fred.

Reply via email to