tests: Introduced SWANCTL flag in test.conf
authorAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 29 Jun 2015 10:43:20 +0000 (12:43 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Tue, 21 Jul 2015 21:17:14 +0000 (23:17 +0200)
testing/do-tests
testing/tests/swanctl/ip-pool-db/test.conf
testing/tests/swanctl/ip-pool/test.conf
testing/tests/swanctl/net2net-cert/test.conf
testing/tests/swanctl/net2net-route/test.conf
testing/tests/swanctl/net2net-start/test.conf
testing/tests/swanctl/rw-cert/test.conf
testing/tests/swanctl/rw-psk-fqdn/test.conf
testing/tests/swanctl/rw-psk-ipv4/test.conf

index 35f13ec..4811aac 100755 (executable)
@@ -254,27 +254,6 @@ do
            continue
        fi
 
-       if [ $SUBDIR = "ipv6" -o $name = "rw-psk-ipv6" ]
-       then
-           IPROUTE_CMD="ip -6 route list table $SOURCEIP_ROUTING_TABLE"
-           IPROUTE_DSP=$IPROUTE_CMD
-           IPTABLES_CMD="ip6tables -v -n -L"
-           IPTABLES_DSP="ip6tables -L"
-       else
-           IPROUTE_CMD="ip route list table $SOURCEIP_ROUTING_TABLE"
-           IPROUTE_DSP=$IPROUTE_CMD
-           IPTABLES_CMD="iptables -v -n -L"
-           IPTABLES_DSP="iptables -L"
-       fi
-
-       if [ $name = "net2net-ip4-in-ip6-ikev2" -o $name = "net2net-ip6-in-ip4-ikev2" ]
-       then
-           IPROUTE_CMD="ip route list table $SOURCEIP_ROUTING_TABLE; echo; ip -6 route list table $SOURCEIP_ROUTING_TABLE"
-           IPROUTE_DSP="ip (-6) route list table $SOURCEIP_ROUTING_TABLE"
-           IPTABLES_CMD="iptables -v -n -L ; echo ; ip6tables -v -n -L"
-           IPTABLES_DSP="iptables -L ; ip6tables -L"
-       fi
-
        [ -f $DEFAULTTESTSDIR/${testname}/description.txt ] || die "!! File 'description.txt' is missing"
        [ -f $DEFAULTTESTSDIR/${testname}/test.conf ]       || die "!! File 'test.conf' is missing"
        [ -f $DEFAULTTESTSDIR/${testname}/pretest.dat ]     || die "!! File 'pretest.dat' is missing"
@@ -351,6 +330,8 @@ do
 
        $DIR/scripts/load-testconfig $testname
        unset RADIUSHOSTS
+       unset IPV6
+       unset SWANCTL
        source $TESTDIR/test.conf
 
 
@@ -487,6 +468,27 @@ do
     <img src="../../images/$DIAGRAM" alt="$VIRTHOSTS">
 @EOF
 
+       if [ -n "$IPV6" -o $SUBDIR = "ipv6" ]
+       then
+           IPROUTE_CMD="ip -6 route list table $SOURCEIP_ROUTING_TABLE"
+           IPROUTE_DSP=$IPROUTE_CMD
+           IPTABLES_CMD="ip6tables -v -n -L"
+           IPTABLES_DSP="ip6tables -L"
+       else
+           IPROUTE_CMD="ip route list table $SOURCEIP_ROUTING_TABLE"
+           IPROUTE_DSP=$IPROUTE_CMD
+           IPTABLES_CMD="iptables -v -n -L"
+           IPTABLES_DSP="iptables -L"
+       fi
+
+       if [ $name = "net2net-ip4-in-ip6-ikev2" -o $name = "net2net-ip6-in-ip4-ikev2" ]
+       then
+           IPROUTE_CMD="ip route list table $SOURCEIP_ROUTING_TABLE; echo; ip -6 route list table $SOURCEIP_ROUTING_TABLE"
+           IPROUTE_DSP="ip (-6) route list table $SOURCEIP_ROUTING_TABLE"
+           IPTABLES_CMD="iptables -v -n -L ; echo ; ip6tables -v -n -L"
+           IPTABLES_DSP="iptables -L ; ip6tables -L"
+       fi
+
        for host in $IPSECHOSTS
        do
            eval HOSTLOGIN=root@\$ipv4_${host}
@@ -494,7 +496,7 @@ do
                scp $SSHCONF $HOSTLOGIN:/etc/strongswan.conf \
                    $TESTRESULTDIR/${host}.strongswan.conf  > /dev/null 2>&1
 
-               if [ $SUBDIR = "swanctl" ]
+               if [  -n "$SWANCTL" ]
                then
                        scp $SSHCONF $HOSTLOGIN:/etc/swanctl/swanctl.conf \
                        $TESTRESULTDIR/${host}.swanctl.conf  > /dev/null 2>&1
@@ -543,7 +545,7 @@ do
                    > $TESTRESULTDIR/${host}.iptables 2>/dev/null
            chmod a+r $TESTRESULTDIR/*
 
-               if [ $SUBDIR = "swanctl" ]
+               if [ -n "$SWANCTL" ]
                then
                    cat >> $TESTRESULTDIR/index.html <<@EOF
     <h3>$host</h3>
index f292988..1227b9d 100755 (executable)
@@ -19,3 +19,7 @@ TCPDUMPHOSTS="moon"
 # Used for IPsec logging purposes
 #
 IPSECHOSTS="moon carol dave"
+
+# charon controlled by swanctl
+#
+SWANCTL=1
index f292988..1227b9d 100755 (executable)
@@ -19,3 +19,7 @@ TCPDUMPHOSTS="moon"
 # Used for IPsec logging purposes
 #
 IPSECHOSTS="moon carol dave"
+
+# charon controlled by swanctl
+#
+SWANCTL=1
index 646b8b3..07a3b24 100755 (executable)
@@ -19,3 +19,7 @@ TCPDUMPHOSTS="sun"
 # Used for IPsec logging purposes
 #
 IPSECHOSTS="moon sun"
+
+# charon controlled by swanctl
+#
+SWANCTL=1
index 646b8b3..07a3b24 100755 (executable)
@@ -19,3 +19,7 @@ TCPDUMPHOSTS="sun"
 # Used for IPsec logging purposes
 #
 IPSECHOSTS="moon sun"
+
+# charon controlled by swanctl
+#
+SWANCTL=1
index 646b8b3..07a3b24 100755 (executable)
@@ -19,3 +19,7 @@ TCPDUMPHOSTS="sun"
 # Used for IPsec logging purposes
 #
 IPSECHOSTS="moon sun"
+
+# charon controlled by swanctl
+#
+SWANCTL=1
index f292988..1227b9d 100755 (executable)
@@ -19,3 +19,7 @@ TCPDUMPHOSTS="moon"
 # Used for IPsec logging purposes
 #
 IPSECHOSTS="moon carol dave"
+
+# charon controlled by swanctl
+#
+SWANCTL=1
index f292988..1227b9d 100755 (executable)
@@ -19,3 +19,7 @@ TCPDUMPHOSTS="moon"
 # Used for IPsec logging purposes
 #
 IPSECHOSTS="moon carol dave"
+
+# charon controlled by swanctl
+#
+SWANCTL=1
index f292988..1227b9d 100755 (executable)
@@ -19,3 +19,7 @@ TCPDUMPHOSTS="moon"
 # Used for IPsec logging purposes
 #
 IPSECHOSTS="moon carol dave"
+
+# charon controlled by swanctl
+#
+SWANCTL=1