/testing/guestbin/swan-prep
west #
 # confirm that the network is alive
west #
 ../../guestbin/wait-until-alive -I 192.0.1.254 192.0.2.254
destination -I 192.0.1.254 192.0.2.254 is alive
west #
 # ensure that clear text does not get through
west #
 iptables -A INPUT -i eth1 -s 192.0.2.0/24 -j DROP
west #
 iptables -I INPUT -m policy --dir in --pol ipsec -j ACCEPT
west #
 # confirm clear text does not get through
west #
 ../../guestbin/ping-once.sh --down -I 192.0.1.254 192.0.2.254
down
west #
 ipsec start
Redirecting to: [initsystem]
west #
 ../../guestbin/wait-until-pluto-started
west #
 ipsec auto --add westnet-eastnet-ipv4-psk-ikev2
002 "westnet-eastnet-ipv4-psk-ikev2": added IKEv2 connection
west #
 echo "initdone"
initdone
west #
 # this should fail
west #
 ipsec auto --up westnet-eastnet-ipv4-psk-ikev2 #retransmits
1v2 "westnet-eastnet-ipv4-psk-ikev2" #1: initiating IKEv2 connection
1v2 "westnet-eastnet-ipv4-psk-ikev2" #1: sent IKE_SA_INIT request
1v2 "westnet-eastnet-ipv4-psk-ikev2" #1: sent IKE_AUTH request {cipher=AES_GCM_16_256 integ=n/a prf=HMAC_SHA2_512 group=MODP2048}
010 "westnet-eastnet-ipv4-psk-ikev2" #1: STATE_V2_PARENT_I2: retransmission; will wait 0.5 seconds for response
010 "westnet-eastnet-ipv4-psk-ikev2" #1: STATE_V2_PARENT_I2: retransmission; will wait 1 seconds for response
010 "westnet-eastnet-ipv4-psk-ikev2" #1: STATE_V2_PARENT_I2: retransmission; will wait 2 seconds for response
010 "westnet-eastnet-ipv4-psk-ikev2" #1: STATE_V2_PARENT_I2: retransmission; will wait 4 seconds for response
010 "westnet-eastnet-ipv4-psk-ikev2" #1: STATE_V2_PARENT_I2: retransmission; will wait 8 seconds for response
010 "westnet-eastnet-ipv4-psk-ikev2" #1: STATE_V2_PARENT_I2: retransmission; will wait 16 seconds for response
010 "westnet-eastnet-ipv4-psk-ikev2" #1: STATE_V2_PARENT_I2: retransmission; will wait 32 seconds for response
031 "westnet-eastnet-ipv4-psk-ikev2" #1: STATE_V2_PARENT_I2: 60 second timeout exceeded after 7 retransmits.  Possible authentication failure: no acceptable response to our first encrypted message
000 "westnet-eastnet-ipv4-psk-ikev2" #1: starting keying attempt 2 of an unlimited number, but releasing whack
003 "westnet-eastnet-ipv4-psk-ikev2" #2: ERROR: netlink response for Del SA esp.ESPSPIi@192.1.2.45 included errno 3: No such process
west #
 # The state should have been deleted, but replaced via event
west #
 # SA_REPLACE with a new state.  If no STATE show up, this test
west #
 # failed
west #
 ../../guestbin/wait-for.sh --match 'sent IKE_AUTH request' -- ipsec status
000 #3: "westnet-eastnet-ipv4-psk-ikev2":500 STATE_V2_PARENT_I2 (sent IKE_AUTH request); RETRANSMIT in XXs; idle;
west #
 # only one pending CHILD SA event should show up
west #
 ipsec status |egrep "STATE_|pending"
000 #3: "westnet-eastnet-ipv4-psk-ikev2":500 STATE_V2_PARENT_I2 (sent IKE_AUTH request); RETRANSMIT in XXs; idle;
000 #3: pending CHILD SA for "westnet-eastnet-ipv4-psk-ikev2"
000 #4: "westnet-eastnet-ipv4-psk-ikev2":500 STATE_V2_IKE_AUTH_CHILD_I0 (ephemeral: initiator creating child from IKE exchange); idle;
west #
 echo done
done
west #
 
