/testing/guestbin/swan-prep --x509
Preparing X.509 files
road #
 certutil -D -n east -d sql:/etc/ipsec.d
road #
 cp road-ikev2-oe.conf /etc/ipsec.d/ikev2-oe.conf
road #
 cp policies/* /etc/ipsec.d/policies/
road #
 echo "192.1.2.0/24"  >> /etc/ipsec.d/policies/private-or-clear
road #
 ipsec start
Redirecting to: [initsystem]
road #
 ../../guestbin/wait-until-pluto-started
road #
 ipsec whack --impair suppress-retransmits
road #
 # give OE policies time to load
road #
 ../../guestbin/wait-for.sh --match 'loaded 2' -- ipsec auto --status
000 Total IPsec connections: loaded 2, active 0
road #
 echo "initdone"
initdone
road #
 # check traffic and shunt status
road #
 ipsec whack --trafficstatus
road #
 ipsec whack --shuntstatus
000 Bare Shunt list:
000  
road #
 # trigger ping, this will be lost
road #
 ../../guestbin/ping-once.sh --forget -I 192.1.3.209 192.1.2.23
fired and forgotten
road #
 ../../guestbin/wait-for.sh --match private-or-clear -- ipsec whack --trafficstatus
006 #2: "private-or-clear#192.1.2.0/24"[1] 10.0.10.1/32=== ...192.1.2.23, type=ESP, add_time=1234567890, inBytes=0, outBytes=0, id='C=CA, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=east.testing.libreswan.org, E=user-east@testing.libreswan.org', lease=10.0.10.1/32
road #
 # ping should succeed through tunnel
road #
 ../../guestbin/ping-once.sh --up -I 192.1.3.209 192.1.2.23
up
road #
 ipsec whack --trafficstatus
006 #2: "private-or-clear#192.1.2.0/24"[1] 10.0.10.1/32=== ...192.1.2.23, type=ESP, add_time=1234567890, inBytes=84, outBytes=84, id='C=CA, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=east.testing.libreswan.org, E=user-east@testing.libreswan.org', lease=10.0.10.1/32
road #
 echo "Crashing the server on east (killing IPsec)"
Crashing the server on east (killing IPsec)
road #
 # check traffic status after east was crashed
road #
 # we expect the old tunnel and no shunts?
road #
 ipsec whack --trafficstatus
006 #2: "private-or-clear#192.1.2.0/24"[1] 10.0.10.1/32=== ...192.1.2.23, type=ESP, add_time=1234567890, inBytes=84, outBytes=84, id='C=CA, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=east.testing.libreswan.org, E=user-east@testing.libreswan.org', lease=10.0.10.1/32
road #
 ipsec whack --shuntstatus
000 Bare Shunt list:
000  
road #
 # wait for DPD on road to trigger down
road #
 ../../guestbin/wait-for.sh --no-match private-or-clear -- ipsec whack --trafficstatus
road #
 # ping again to trigger OE. packet is lost
road #
 ../../guestbin/ping-once.sh --forget -I 192.1.3.209 192.1.2.23
fired and forgotten
road #
 # check ping, expected to succeed now via %pass
road #
 ../../guestbin/wait-for.sh --match %pass -- ipsec whack --shuntstatus
000 192.1.3.209/32 -0-> 192.1.2.23/32 => %pass 0    oe-failed
road #
 ../../guestbin/ping-once.sh --up -I 192.1.3.209 192.1.2.23
up
road #
 # should show no tunnel
road #
 ipsec whack --trafficstatus
road #
 # check traffic status after crashed server restarted
road #
 # we expect no tunnel and %pass shunt still in place
road #
 ipsec whack --trafficstatus
road #
 ipsec whack --shuntstatus
000 Bare Shunt list:
000  
000 192.1.3.209/32 -0-> 192.1.2.23/32 => %pass 0    oe-failed
road #
 
