Add a simple test case for the unity plugin, featuring both includes and excludes

This commit is contained in:
Martin Willi
2012-09-18 17:20:47 +02:00
parent f728ae590b
commit 995a9c8a0a
9 changed files with 113 additions and 0 deletions
@@ -0,0 +1,6 @@
The roadwarrior <b>carol</b> sets up a connection to gateway <b>moon</b>.
The authentication is based on <b>X.509 certificates</b>. <b>carol</b>
requests a virtual IP using <b>leftsourceip=%config</b> and indicates
support for the Cisco Unity extension. Gateway <b>moon</b> responds with
two Split-Include subnets configured in the <b>leftsubnet</b> definition and a
global Local-LAN exclude option defined in strongswan.conf.
@@ -0,0 +1,8 @@
carol::ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.strongswan.org::YES
moon:: ipsec status 2> /dev/null::rw\[1]: ESTABLISHED.*moon.strongswan.org.*[email protected]::YES
carol::ipsec status 2> /dev/null::10.2.1.1/32 === 192.168.0.0/24 PASS::YES
carol::ipsec status 2> /dev/null::home.*10.2.1.1/32 === 10.1.0.0/16 10.2.1.0/24::YES
moon:: ipsec status 2> /dev/null::rw[{]1}.*10.1.0.0/16 10.2.1.0/24 === 10.2.1.1/32::YES
carol::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_seq=1::YES
moon::tcpdump::IP carol.strongswan.org > moon.strongswan.org: ESP::YES
moon::tcpdump::IP moon.strongswan.org > carol.strongswan.org: ESP::YES
@@ -0,0 +1,20 @@
# /etc/ipsec.conf - strongSwan IPsec configuration file
config setup
conn %default
ikelifetime=60m
keylife=20m
rekeymargin=3m
keyingtries=1
keyexchange=ikev1
conn home
left=PH_IP_CAROL
leftcert=carolCert.pem
[email protected]
leftsourceip=%config
right=PH_IP_MOON
[email protected]
rightsubnet=0.0.0.0/0
auto=add
@@ -0,0 +1,14 @@
# /etc/strongswan.conf - strongSwan configuration file
charon {
load = curl test-vectors aes des sha1 sha2 md5 pem pkcs1 pkcs8 gmp random nonce x509 revocation hmac xcbc ctr ccm gcm stroke kernel-netlink socket-default unity
cisco_unity = yes
}
libstrongswan {
dh_exponent_ansi_x9_42 = no
integrity_test = yes
crypto_test {
on_add = yes
}
}
@@ -0,0 +1,19 @@
# /etc/ipsec.conf - strongSwan IPsec configuration file
config setup
conn %default
ikelifetime=60m
keylife=20m
rekeymargin=3m
keyingtries=1
keyexchange=ikev1
conn rw
left=PH_IP_MOON
leftcert=moonCert.pem
[email protected]
leftsubnet=10.1.0.0/16,10.2.1.0/24
right=%any
rightsourceip=10.2.1.0/24
auto=add
@@ -0,0 +1,19 @@
# /etc/strongswan.conf - strongSwan configuration file
charon {
load = curl test-vectors aes des sha1 sha2 md5 pem pkcs1 pkcs8 gmp random nonce x509 revocation hmac xcbc ctr ccm gcm stroke kernel-netlink socket-default attr unity
cisco_unity = yes
plugins {
attr {
split-exclude = 192.168.0.0/24
}
}
}
libstrongswan {
dh_exponent_ansi_x9_42 = no
integrity_test = yes
crypto_test {
on_add = yes
}
}
@@ -0,0 +1,2 @@
moon::ipsec stop
carol::ipsec stop
@@ -0,0 +1,4 @@
moon::ipsec start
carol::ipsec start
carol::sleep 1
carol::ipsec up home
@@ -0,0 +1,21 @@
#!/bin/bash
#
# This configuration file provides information on the
# UML instances used for this test
# All UML instances that are required for this test
#
UMLHOSTS="alice moon carol winnetou"
# Corresponding block diagram
#
DIAGRAM="a-m-c.png"
# UML instances on which tcpdump is to be started
#
TCPDUMPHOSTS="moon"
# UML instances on which IPsec is started
# Used for IPsec logging purposes
#
IPSECHOSTS="moon carol"