Blame SOURCES/unbound-1.6.6-test-fwd_oneport.patch

4365f2
From f41fcb93de47ddf2ec5063be1df29e99cafc61c0 Mon Sep 17 00:00:00 2001
4365f2
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
4365f2
Date: Wed, 11 Oct 2017 23:04:50 +0200
4365f2
Subject: [PATCH 1/2] Do not fail if two tests run on the same machine.
4365f2
 Randomize outgoing port too.
4365f2
4365f2
---
4365f2
 testdata/fwd_oneport.tdir/fwd_oneport.conf | 2 +-
4365f2
 testdata/fwd_oneport.tdir/fwd_oneport.pre  | 7 +++++--
4365f2
 2 files changed, 6 insertions(+), 3 deletions(-)
4365f2
4365f2
diff --git a/testdata/fwd_oneport.tdir/fwd_oneport.conf b/testdata/fwd_oneport.tdir/fwd_oneport.conf
4365f2
index f3427fe..76cade4 100644
4365f2
--- a/testdata/fwd_oneport.tdir/fwd_oneport.conf
4365f2
+++ b/testdata/fwd_oneport.tdir/fwd_oneport.conf
4365f2
@@ -5,7 +5,7 @@ server:
4365f2
 	port: @PORT@
4365f2
 	outgoing-range: 2
4365f2
 	outgoing-port-avoid: 0-65535
4365f2
-	outgoing-port-permit: 20675
4365f2
+	outgoing-port-permit: @OUTPORT@
4365f2
 	directory: ""
4365f2
 	pidfile: "unbound.pid"
4365f2
 	chroot: ""
4365f2
diff --git a/testdata/fwd_oneport.tdir/fwd_oneport.pre b/testdata/fwd_oneport.tdir/fwd_oneport.pre
4365f2
index eeb5238..256d8dc 100644
4365f2
--- a/testdata/fwd_oneport.tdir/fwd_oneport.pre
4365f2
+++ b/testdata/fwd_oneport.tdir/fwd_oneport.pre
4365f2
@@ -5,11 +5,13 @@
4365f2
 [ -f .tpkg.var.test ] && source .tpkg.var.test
4365f2
 
4365f2
 . ../common.sh
4365f2
-get_random_port 2
4365f2
+get_random_port 3
4365f2
 UNBOUND_PORT=$RND_PORT
4365f2
 FWD_PORT=$(($RND_PORT + 1))
4365f2
+OUT_PORT=$(($RND_PORT + 2))
4365f2
 echo "UNBOUND_PORT=$UNBOUND_PORT" >> .tpkg.var.test
4365f2
 echo "FWD_PORT=$FWD_PORT" >> .tpkg.var.test
4365f2
+echo "OUT_PORT=$OUT_PORT" >> .tpkg.var.test
4365f2
 
4365f2
 # start forwarder
4365f2
 get_ldns_testns
4365f2
@@ -18,7 +20,8 @@ FWD_PID=$!
4365f2
 echo "FWD_PID=$FWD_PID" >> .tpkg.var.test
4365f2
 
4365f2
 # make config file
4365f2
-sed -e 's/@PORT\@/'$UNBOUND_PORT'/' -e 's/@TOPORT\@/'$FWD_PORT'/' < fwd_oneport.conf > ub.conf
4365f2
+sed -e 's/@PORT\@/'$UNBOUND_PORT'/' -e 's/@TOPORT\@/'$FWD_PORT'/' -e 's/@OUTPORT\@/'$OUT_PORT'/' < fwd_oneport.conf > ub.conf
4365f2
+
4365f2
 # start unbound in the background
4365f2
 PRE="../.."
4365f2
 $PRE/unbound -d -c ub.conf >unbound.log 2>&1 &
4365f2
-- 
4365f2
2.9.5
4365f2