Skip to contentSkip to conversation

Prevent generation of duplicate EXPECT_IFCONFIG entries

PATCH Superseded [email protected]... 1 participant 1 message Nov 4, 2016

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Prevent generation of duplicate EXPECT_IFCONFIG entries

From: Samuli Seppänen <[email protected]...>

Previously, if t_client.rc did not source t_client_ips.rc, update_t_client_ips.sh would add (the same) EXPECT_IFCONFIG entries to t_client_ips.rc on every run. With this patch update_t_client_ips.sh checks if the entry exists before adding it.

---
 tests/update_t_client_ips.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/update_t_client_ips.sh +2 -2
index e7b58ba..9fd1c46 100755
@@ -3,5 +3,5 @@
 # This --up script caches the IPs handed out by the test VPN server to a file
 # for later use.
 
-echo "EXPECT_IFCONFIG4_$TESTNUM=$ifconfig_local" >> $TOP_BUILDDIR/t_client_ips.rc
-echo "EXPECT_IFCONFIG6_$TESTNUM=$ifconfig_ipv6_local" >> $TOP_BUILDDIR/t_client_ips.rc
+grep EXPECT_IFCONFIG4_$TESTNUM $TOP_BUILDDIR/t_client_ips.rc || echo "EXPECT_IFCONFIG4_$TESTNUM=$ifconfig_local" >> $TOP_BUILDDIR/t_client_ips.rc
+grep EXPECT_IFCONFIG6_$TESTNUM $TOP_BUILDDIR/t_client_ips.rc || echo "EXPECT_IFCONFIG6_$TESTNUM=$ifconfig_ipv6_local" >> $TOP_BUILDDIR/t_client_ips.rc
Signature · 1 line
2.1.4