/testing/guestbin/swan-prep
west #
 ipsec start
Redirecting to: [initsystem]
west #
 ../../guestbin/wait-until-pluto-started
west #
 # sourceip is shown as {my,their}_ip=
west #
 add() { ipsec auto --add $1 ; ipsec whack --connectionstatus --name $1 | grep _ip= ; }
west #
 # fails because there's no subnet=
west #
 add sourceip-without-selector
"sourceip-without-selector": failed to add connection: leftsourceip=1.0.0.1 invalid, requires leftsubnet
west #
 add sourceips-without-selector
"sourceips-without-selector": failed to add connection: leftsourceip=1.0.0.1,1::1 invalid, requires leftsubnet
west #
 # fails because sourceip is not within subnet
west #
 add sourceip-outside-selector
"sourceip-outside-selector": failed to add connection: leftsourceip=1.0.0.1 address 1.0.0.1 is not within leftsubnet=2.0.0.0/24
west #
 # fails because sourceip is not within subnet
west #
 add sourceips-outside-selectors
"sourceips-outside-selectors": failed to add connection: leftsourceip=1.0.0.1,1::1 address 1::1 is not within leftsubnet=2::/64,1.0.0.0/24
west #
 # all good
west #
 add sourceip-inside-selector
"sourceip-inside-selector": added IKEv2 connection
"sourceip-inside-selector": 1.0.0.0/24===192.1.2.45[@west]...192.1.2.23[@east]; unrouted; my_ip=1.0.0.1; their_ip=unset;
west #
 add sourceips-inside-selectors
"sourceips-inside-selectors": connection is using multiple subnets
"sourceips-inside-selectors": added IKEv2 connection
"sourceips-inside-selectors": 1.0.0.0/24===192.1.2.45[@west]...192.1.2.23[@east]===2.0.0.0/24; unrouted; my_ip=1.0.0.1; their_ip=unset;
"sourceips-inside-selectors": 1::/64===192.1.2.45[@west]...192.1.2.23[@east]===2::/64; unrouted; my_ip=1::1; their_ip=unset;
west #
 # subnets= tests can't check inside/outside
west #
 add sourceip-outside-subnets
"sourceip-outside-subnets/1x0": added IKEv2 connection
"sourceip-outside-subnets/1x0": 2.0.0.0/24===192.1.2.45[@west]...192.1.2.23[@east]; unrouted; my_ip=unset; their_ip=unset;
west #
 add sourceip-inside-subnets
"sourceip-inside-subnets/1x0": added IKEv2 connection
"sourceip-inside-subnets/1x0": 1.0.0.0/24===192.1.2.45[@west]...192.1.2.23[@east]; unrouted; my_ip=1.0.0.1; their_ip=unset;
west #
 add sourceips-inside-subnets
"sourceips-inside-subnets/1x1": connection is using multiple sourceips
"sourceips-inside-subnets/1x1": added IKEv2 connection
"sourceips-inside-subnets": warning: skipping mismatched leftsubnets=1::/64 rightsubnets=2.0.0.0/24
"sourceips-inside-subnets": warning: skipping mismatched leftsubnets=1.0.0.0/24 rightsubnets=2::/64
"sourceips-inside-subnets/2x2": connection is using multiple sourceips
"sourceips-inside-subnets/2x2": added IKEv2 connection
"sourceips-inside-subnets/2x2": 1.0.0.0/24===192.1.2.45[@west]...192.1.2.23[@east]===2.0.0.0/24; unrouted; my_ip=1.0.0.1; their_ip=unset;
"sourceips-inside-subnets/1x1": 1::/64===192.1.2.45[@west]...192.1.2.23[@east]===2::/64; unrouted; my_ip=1::1; their_ip=unset;
west #
 add sourceip-vs-interface-ip
"sourceip-vs-interface-ip": failed to add connection: leftsourceip=1.0.0.1 invalid, requires leftsubnet
west #
 
