/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 add west-east
"west-east": added IKEv2 connection
west #
 ipsec whack --impair suppress_retransmits
west #
 ipsec whack --impair revival
west #
 ipsec route west-east
west #
 # Initiate; during IKE_AUTH the child should fail and the connection
west #
 # put on to the revival queue
west #
 ipsec up west-east
"west-east" #1: initiating IKEv2 connection to 192.1.2.23 using UDP
"west-east" #1: sent IKE_SA_INIT request to 192.1.2.23:UDP/500
"west-east" #1: processed IKE_SA_INIT response from 192.1.2.23:UDP/500 {cipher=AES_GCM_16_256 integ=n/a prf=HMAC_SHA2_512 group=DH19}, initiating IKE_AUTH
"west-east" #1: sent IKE_AUTH request to 192.1.2.23:UDP/500
"west-east" #1: initiator established IKE SA; authenticated peer using authby=secret and ID_FQDN '@east'
"west-east" #2: IKE_AUTH response missing v2SA, v2TSi or v2TSr: not attempting to setup CHILD SA
"west-east" #1: IKE SA established but initiator rejected Child SA response
"west-east" #2: sent INFORMATIONAL request to delete larval Child SA using IKE SA #1
"west-east" #2: connection is supposed to remain up; revival attempt 1 scheduled in 0 seconds
"west-east" #2: IMPAIR: revival: skip scheduling revival event
west #
 # expect the on-demand kernel policy
west #
 ../../guestbin/ipsec-kernel-policy.sh
src 192.0.1.0/24 dst 192.0.2.0/24
	dir out priority PRIORITY ptype main
	tmpl src 0.0.0.0 dst 0.0.0.0
		proto esp reqid 0 mode transport
west #
 # Trigger an acquire; this fast track the revival using
west #
 # CREATE_CHILD_SA and again it will fail
west #
 ../../guestbin/ping-once.sh --down -I 192.0.1.254 192.0.2.254
down
west #
 ../../guestbin/wait-for-pluto.sh '#3: IMPAIR: revival'
"west-east" #3: IMPAIR: revival: skip scheduling revival event
west #
 ../../guestbin/ipsec-kernel-state.sh
src 192.0.1.254 dst 192.0.2.254
	proto esp spi 0x00000000 reqid 0 mode transport
	replay-window 0 
	sel src 192.0.1.254/32 dst 192.0.2.254/32 proto icmp type 8 code 0 dev eth1 
west #
 ../../guestbin/ipsec-kernel-policy.sh
src 192.0.1.0/24 dst 192.0.2.0/24
	dir out priority PRIORITY ptype main
	tmpl src 0.0.0.0 dst 0.0.0.0
		proto esp reqid 0 mode transport
west #
 ipsec unroute west-east
west #
 
