malmond / rpms / unbound

Forked from rpms/unbound 3 years ago
Clone

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

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