From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Ehrhardt Subject: [PATCH iproute2 v2 1/2] tests: read limited amount from /dev/urandom Date: Wed, 10 Jan 2018 16:11:36 +0100 Message-ID: <1515597097-870-2-git-send-email-christian.ehrhardt@canonical.com> References: <1515597097-870-1-git-send-email-christian.ehrhardt@canonical.com> Cc: Luca Boccassi , Christian Ehrhardt To: Netdev Return-path: Received: from youngberry.canonical.com ([91.189.89.112]:44862 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753368AbeAJPLk (ORCPT ); Wed, 10 Jan 2018 10:11:40 -0500 In-Reply-To: <1515597097-870-1-git-send-email-christian.ehrhardt@canonical.com> Sender: netdev-owner@vger.kernel.org List-ID: 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 --- testsuite/lib/generic.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/lib/generic.sh b/testsuite/lib/generic.sh index b7de704..3645ff5 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() -- 2.7.4