/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 #
 # sourceip=;host=;#subnet= ok
west #
 add sourceip-inside-host
"sourceip-inside-host": added IKEv2 connection
"sourceip-inside-host": 192.1.2.45[@west]...192.1.2.23[@east]; unrouted; my_ip=192.1.2.45; their_ip=unset;
west #
 add sourceip-outside-host
"sourceip-outside-host": failed to add connection: leftsourceip=192.1.2.46 invalid, address 192.1.2.46 does not match left=192.1.2.45 and leftsubnet= was not specified
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 invalid, 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 invalid, 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=1.0.0.1; 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-inside-subnet-protoport
"sourceip-inside-subnet-protoport": added IKEv2 connection
"sourceip-inside-subnet-protoport": 1.0.0.1/32/TCP/22===192.1.2.45[@west]...192.1.2.23[@east]; unrouted; my_ip=1.0.0.1; their_ip=unset;
west #
 add sourceip-outside-subnet-protoport
"sourceip-outside-subnet-protoport": failed to add connection: leftsourceip=1.0.0.1 invalid, address 1.0.0.1 is not within leftsubnet=1.2.3.4/32
west #
 add sourceip-inside-selector-protocol-port
"sourceip-inside-selector-protocol-port": added IKEv2 connection
"sourceip-inside-selector-protocol-port": 1.0.0.1/32/TCP/22===192.1.2.45[@west]...192.1.2.23[@east]; unrouted; my_ip=1.0.0.1; their_ip=unset;
west #
 add sourceip-outside-selector-protocol-port
"sourceip-outside-selector-protocol-port": failed to add connection: leftsourceip=1.0.0.1 invalid, address 1.0.0.1 is not within leftsubnet=1.2.3.4/32/tcp/22
west #
 add sourceip-vs-interface-ip
"sourceip-vs-interface-ip": failed to add connection: cannot specify leftinterface-ip=1.2.3.4/32 and leftssourceip=1.0.0.1
west #
 add sourceip-ipv4-ipv6-ipv4
"sourceip-ipv4-ipv6-ipv4": failed to add connection: leftsourceip=1.0.0.1,1::1,1.0.0.2 invalid, multiple IPv4 addresses (1.0.0.1 and 1.0.0.2) specified
west #
 add sourceip-ipv6-ipv4-ipv6
"sourceip-ipv6-ipv4-ipv6": failed to add connection: leftsourceip=1::1,1.0.0.1,1::2 invalid, multiple IPv6 addresses (1::1 and 1::2) specified
west #
 
