tests: in the stub ip command, avoid broken pipe by using echo instead of cat
authorMichael Adam <obnox@samba.org>
Wed, 27 Nov 2013 11:13:40 +0000 (12:13 +0100)
committerAmitay Isaacs <amitay@gmail.com>
Fri, 31 Jan 2014 05:04:31 +0000 (16:04 +1100)
This fixes running "make autotest" from autobuild, since
it prevents irritating error output in delete_ip_from_iface()
when calling ip addr list ... | grep -Fq "inet ..." .

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit 70f469e05e279e29980df2af10dd89c53001b236)

tests/eventscripts/stubs/ip

index 053da750b9cb7a21015c39cf94e4bdce17ab1022..d4c9d8ab7ddcdedbe2355b515aa3c91be740d0ba 100755 (executable)
@@ -166,25 +166,19 @@ ip_addr_show ()
            read local <"$pf"
            if [ -z "$_to" -o "${_to%/*}" = "${local%/*}" ] ; then
                calc_brd
-               cat <<EOF
-    inet ${local} brd ${brd} scope global ${dev}
-EOF
+               echo "    inet ${local} brd ${brd} scope global ${dev}"
            fi
        fi
        if $secondary && [ -r "$sf" ] ; then
            while read local ; do
                if [ -z "$_to" -o "${_to%/*}" = "${local%/*}" ] ; then
                    calc_brd
-                   cat <<EOF
-    inet ${local} brd ${brd} scope global secondary ${dev}
-EOF
+                   echo "    inet ${local} brd ${brd} scope global secondary ${dev}"
                fi
            done <"$sf"
        fi
        if [ -z "$_to" ] ; then
-           cat <<EOF
-       valid_lft forever preferred_lft forever
-EOF
+           echo "       valid_lft forever preferred_lft forever"
        fi
     }
     n=1