Iain Morgan
2013-Mar-11 18:33 UTC
[PATCH] Portability improvements for regress/cipher-speed.sh
Hi, Although cipher-speed.sh isn't failing, its output is useless on some platforms. Aside from the definition of $DATA noted in a previous post to this list, it makes assumptions about dd's status message and the behaviour of echo. The patch below addresses these issue, at least on RHEL. Index: regress/cipher-speed.sh ==================================================================RCS file: /cvs/openssh/regress/cipher-speed.sh,v retrieving revision 1.10 diff -u -r1.10 cipher-speed.sh --- regress/cipher-speed.sh 19 Feb 2013 19:53:30 -0000 1.10 +++ regress/cipher-speed.sh 11 Mar 2013 18:19:14 -0000 @@ -5,12 +5,13 @@ getbytes () { - sed -n '/transferred/s/.*secs (\(.* bytes.sec\).*/\1/p' + sed -n -e '/transferred/s/.*secs (\(.* bytes.sec\).*/\1/p' \ + -e '/copied/s/.*s, \(.* MB.s\).*/\1/p' } tries="1 2" -DATA=/bin/ls -DATA=/bsd +DATA=/tmp/cipher-speed.$$ +dd if=/dev/zero of=$DATA bs=4k count=1024 2> /dev/null ciphers="aes128-cbc 3des-cbc blowfish-cbc cast128-cbc arcfour128 arcfour256 arcfour @@ -26,7 +27,7 @@ for c in $ciphers; do n=0; for m in $macs; do trace "proto 2 cipher $c mac $m" for x in $tries; do - echon "$c/$m:\t" + printf "%-60s" "$c/$m:" ( ${SSH} -o 'compression no' \ -F $OBJ/ssh_proxy -2 -m $m -c $c somehost \ exec sh -c \'"dd of=/dev/null obs=32k"\' \ @@ -47,7 +48,7 @@ for c in $ciphers; do trace "proto 1 cipher $c" for x in $tries; do - echon "$c:\t" + printf "%-60s" "$c:" ( ${SSH} -o 'compression no' \ -F $OBJ/ssh_proxy -1 -c $c somehost \ exec sh -c \'"dd of=/dev/null obs=32k"\' \ @@ -57,3 +58,5 @@ fi done done + +rm $DATA -- Iain Morgan
Darren Tucker
2013-Mar-11 23:20 UTC
[PATCH] Portability improvements for regress/cipher-speed.sh
On Mon, Mar 11, 2013 at 11:33:35AM -0700, Iain Morgan wrote:> Hi, > > Although cipher-speed.sh isn't failing, its output is useless on some > platforms. Aside from the definition of $DATA noted in a previous post > to this list, it makes assumptions about dd's status message and the > behaviour of echo. > > The patch below addresses these issue, at least on RHEL.The patch makes assumptions about the existence of /dev/zero :-) I'd rather have test-exec.sh create (and cleanup) $DATA in one place, maybe by concatenating sshd$(EXEEXT) a few times. Also, why the echon->printf changes? -- Darren Tucker (dtucker at zip.com.au) GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69 Good judgement comes with experience. Unfortunately, the experience usually comes from bad judgement.