From: Christian Ehrhardt Date: Wed, 10 Jan 2018 15:11:36 +0000 (+0100) Subject: tests: read limited amount from /dev/urandom X-Git-Tag: v4.15.0~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4afbeaeeafe8475d42127935fcf511aca30b2063;p=thirdparty%2Fiproute2.git tests: read limited amount from /dev/urandom In some test environments like e.g. Ubuntu & Debian autopkgtest it can happen that while generating random device names the pipes between tr and head are considered dead while processing. That prints (non fatal) issues like: Running ip/link/new_link.t [iproute2-this/4.13.0-17-generic]: tr: write error: Broken pipe tr: write error PASS This only happens if reading an infinite amount of chars with the read from urandom, so reading a defined amount fixes the issue. Signed-off-by: Christian Ehrhardt Signed-off-by: Stephen Hemminger --- diff --git a/testsuite/lib/generic.sh b/testsuite/lib/generic.sh index b7de70441..3645ff52d 100644 --- a/testsuite/lib/generic.sh +++ b/testsuite/lib/generic.sh @@ -87,7 +87,7 @@ ts_qdisc_available() rand_dev() { - echo "dev-$(tr -dc "[:alpha:]" < /dev/urandom | head -c 6)" + echo "dev-$(head -c 250 /dev/urandom | tr -dc '[:alpha:]' | head -c 6)" } pr_failed()