]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
testing: Use expect-connection in swanctl scenarios
authorTobias Brunner <tobias@strongswan.org>
Thu, 19 Nov 2015 16:53:31 +0000 (17:53 +0100)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Fri, 11 Dec 2015 17:26:53 +0000 (18:26 +0100)
Only in net2net-start do we have to use `sleep` to ensure the SA is
up when the tests are running.

13 files changed:
testing/tests/swanctl/frags-ipv4/pretest.dat
testing/tests/swanctl/frags-ipv6/pretest.dat
testing/tests/swanctl/ip-pool-db/pretest.dat
testing/tests/swanctl/ip-pool/pretest.dat
testing/tests/swanctl/multi-level-ca/pretest.dat
testing/tests/swanctl/net2net-cert/pretest.dat
testing/tests/swanctl/net2net-route/pretest.dat
testing/tests/swanctl/net2net-start/pretest.dat
testing/tests/swanctl/ocsp-multi-level/pretest.dat
testing/tests/swanctl/rw-cert/pretest.dat
testing/tests/swanctl/rw-hash-and-url/pretest.dat
testing/tests/swanctl/rw-psk-fqdn/pretest.dat
testing/tests/swanctl/rw-psk-ipv4/pretest.dat

index 706bd1edd3b124e651e74ab071c7ebb9bab64e84..762c35418b6c77366ac33a2e658c6c49778bfcfa 100755 (executable)
@@ -4,6 +4,8 @@ dave::iptables-restore < /etc/iptables.rules
 moon::service charon start 2> /dev/null
 carol::service charon start 2> /dev/null
 dave::service charon start 2> /dev/null
-moon::sleep 1
+moon::expect-connection rw
+carol::expect-connection home
 carol::swanctl --initiate --child home 2> /dev/null
+dave::expect-connection home
 dave::swanctl --initiate --child home 2> /dev/null
index 868038678f8fe976910973760f3c7520b5153e79..9593ac9f82c311640e9182105d0fcdacff74f94c 100755 (executable)
@@ -10,6 +10,8 @@ dave::"ip route add fec1:\:/16 via fec0:\:1"
 moon::service charon start 2> /dev/null
 carol::service charon start 2> /dev/null
 dave::service charon start 2> /dev/null
-moon::sleep 1
+moon::expect-connection rw
+carol::expect-connection home
 carol::swanctl --initiate --child home 2> /dev/null
+dave::expect-connection home
 dave::swanctl --initiate --child home 2> /dev/null
index 91380e6f9e25292b36dd5f42cbe19a6d6121c89f..955a3c9be9bd30ec48da66c3b04da9521406b1ff 100755 (executable)
@@ -7,9 +7,11 @@ moon::ipsec pool --addattr nbns --server PH_IP_VENUS 2> /dev/null
 moon::iptables-restore < /etc/iptables.rules
 carol::iptables-restore < /etc/iptables.rules
 dave::iptables-restore < /etc/iptables.rules
-moon::service charon start 2> /dev/null 
+moon::service charon start 2> /dev/null
 carol::service charon start 2> /dev/null
 dave::service charon start 2> /dev/null
-moon::sleep 1
+moon::expect-connection rw
+carol::expect-connection home
 carol::swanctl --initiate --child home 2> /dev/null
+dave::expect-connection home
 dave::swanctl --initiate --child home 2> /dev/null
index 706bd1edd3b124e651e74ab071c7ebb9bab64e84..762c35418b6c77366ac33a2e658c6c49778bfcfa 100755 (executable)
@@ -4,6 +4,8 @@ dave::iptables-restore < /etc/iptables.rules
 moon::service charon start 2> /dev/null
 carol::service charon start 2> /dev/null
 dave::service charon start 2> /dev/null
-moon::sleep 1
+moon::expect-connection rw
+carol::expect-connection home
 carol::swanctl --initiate --child home 2> /dev/null
+dave::expect-connection home
 dave::swanctl --initiate --child home 2> /dev/null
index 61ac75d8485a3c97d697c5d547b9cd44ea8d6d48..4c1be2e140e6601b800331b7a24abcc19a1d738e 100644 (file)
@@ -1,8 +1,10 @@
 moon::service charon start 2> /dev/null
 carol::service charon start 2> /dev/null
 dave::service charon start 2> /dev/null
-moon::sleep 1
+moon::expect-connection research
+carol::expect-connection alice
 carol::swanctl --initiate --child alice 2> /dev/null
 carol::swanctl --initiate --child venus 2> /dev/null
+dave::expect-connection alice
 dave::swanctl --initiate --child alice 2> /dev/null
 dave::swanctl --initiate --child venus 2> /dev/null
index 81410ffc252123f8adb8ab9b44cc72962edf02e2..b128bef44ef14ec2215d33ee2dadb9e2429d26fb 100755 (executable)
@@ -2,5 +2,6 @@ moon::iptables-restore < /etc/iptables.rules
 sun::iptables-restore < /etc/iptables.rules
 moon::service charon start 2> /dev/null
 sun::service charon start 2> /dev/null
-moon::sleep 1
+moon::expect-connection gw-gw
+sun::expect-connection gw-gw
 moon::swanctl --initiate --child net-net 2> /dev/null
index 065d38d766206b60cccad427001057615a9a4ad7..459879bbc5bd40c024a5fe90712f5a37ff76a465 100755 (executable)
@@ -2,5 +2,6 @@ sun::iptables-restore < /etc/iptables.rules
 moon::iptables-restore < /etc/iptables.rules
 sun::service charon start 2> /dev/null
 moon::service charon start 2> /dev/null
-moon::sleep 1
-alice::ping -c 3 10.2.0.10
+sun::expect-connection gw-gw
+moon::expect-connection gw-gw
+alice::ping -c 3 -W 1 -i 0.2 PH_IP_BOB
index e4198365f5d861a5b4279c153d5300ced0fce51e..6c1783b74778184c792ed3241e11682e910b5a52 100755 (executable)
@@ -2,4 +2,4 @@ sun::iptables-restore < /etc/iptables.rules
 moon::iptables-restore < /etc/iptables.rules
 sun::service charon start 2> /dev/null
 moon::service charon start 2> /dev/null
-moon::sleep 1
+moon::sleep 0.5
index 61ac75d8485a3c97d697c5d547b9cd44ea8d6d48..7b83e219dae163f8ed26e8b6a71d0073aa577f69 100644 (file)
@@ -1,8 +1,10 @@
 moon::service charon start 2> /dev/null
 carol::service charon start 2> /dev/null
 dave::service charon start 2> /dev/null
-moon::sleep 1
+moon::expect-connection research
+carol::expect-connection home
 carol::swanctl --initiate --child alice 2> /dev/null
 carol::swanctl --initiate --child venus 2> /dev/null
+dave::expect-connection home
 dave::swanctl --initiate --child alice 2> /dev/null
 dave::swanctl --initiate --child venus 2> /dev/null
index 706bd1edd3b124e651e74ab071c7ebb9bab64e84..762c35418b6c77366ac33a2e658c6c49778bfcfa 100755 (executable)
@@ -4,6 +4,8 @@ dave::iptables-restore < /etc/iptables.rules
 moon::service charon start 2> /dev/null
 carol::service charon start 2> /dev/null
 dave::service charon start 2> /dev/null
-moon::sleep 1
+moon::expect-connection rw
+carol::expect-connection home
 carol::swanctl --initiate --child home 2> /dev/null
+dave::expect-connection home
 dave::swanctl --initiate --child home 2> /dev/null
index 706bd1edd3b124e651e74ab071c7ebb9bab64e84..762c35418b6c77366ac33a2e658c6c49778bfcfa 100755 (executable)
@@ -4,6 +4,8 @@ dave::iptables-restore < /etc/iptables.rules
 moon::service charon start 2> /dev/null
 carol::service charon start 2> /dev/null
 dave::service charon start 2> /dev/null
-moon::sleep 1
+moon::expect-connection rw
+carol::expect-connection home
 carol::swanctl --initiate --child home 2> /dev/null
+dave::expect-connection home
 dave::swanctl --initiate --child home 2> /dev/null
index d55df408c212ff77974ae7d95c73acb8a77ccad1..519b168aeeb0f931b804a25aea066a707d8619ff 100755 (executable)
@@ -7,6 +7,8 @@ dave::cd /etc/swanctl; rm rsa/* x509/* x509ca/*
 moon::service charon start 2> /dev/null
 carol::service charon start 2> /dev/null
 dave::service charon start 2> /dev/null
-moon::sleep 1
+moon::expect-connection rw
+carol::expect-connection home
 carol::swanctl --initiate --child home 2> /dev/null
+dave::expect-connection home
 dave::swanctl --initiate --child home 2> /dev/null
index d55df408c212ff77974ae7d95c73acb8a77ccad1..519b168aeeb0f931b804a25aea066a707d8619ff 100755 (executable)
@@ -7,6 +7,8 @@ dave::cd /etc/swanctl; rm rsa/* x509/* x509ca/*
 moon::service charon start 2> /dev/null
 carol::service charon start 2> /dev/null
 dave::service charon start 2> /dev/null
-moon::sleep 1
+moon::expect-connection rw
+carol::expect-connection home
 carol::swanctl --initiate --child home 2> /dev/null
+dave::expect-connection home
 dave::swanctl --initiate --child home 2> /dev/null