]> git.ipfire.org Git - people/ms/network.git/commitdiff
Add include recipe for nitsi vpn n2n tests
authorJonatan Schlag <jonatan.schlag@ipfire.org>
Sat, 15 Sep 2018 11:48:08 +0000 (13:48 +0200)
committerJonatan Schlag <jonatan.schlag@ipfire.org>
Sat, 15 Sep 2018 11:48:08 +0000 (13:48 +0200)
This recipes are the base for all n2n ipsec tests.

Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
test/nitsi/include/vpn-base [new file with mode: 0644]
test/nitsi/include/vpn-ipsec-basic-connection [new file with mode: 0644]
test/nitsi/include/vpn-ipsec-basic-peer-ipv4 [new file with mode: 0644]
test/nitsi/include/vpn-ipsec-basic-peer-ipv6 [new file with mode: 0644]
test/nitsi/include/vpn-ipsec-basic-ping-test-ipv4 [new file with mode: 0644]
test/nitsi/include/vpn-ipsec-basic-ping-test-ipv6 [new file with mode: 0644]
test/nitsi/include/vpn-ipsec-basic-ping-test-ipv64 [new file with mode: 0644]
test/nitsi/include/vpn-ipsec-basic-ts-ipv4 [new file with mode: 0644]
test/nitsi/include/vpn-ipsec-basic-ts-ipv6 [new file with mode: 0644]
test/nitsi/include/vpn-ipsec-basic-ts-ipv64 [new file with mode: 0644]
test/nitsi/include/vpn-ipsec-basic-vti-test [new file with mode: 0644]

diff --git a/test/nitsi/include/vpn-base b/test/nitsi/include/vpn-base
new file mode 100644 (file)
index 0000000..a79bec4
--- /dev/null
@@ -0,0 +1,37 @@
+# This contains the basic network configuration for all vpn-tests
+include: ../include/make-install
+include: ../include/network-settings
+include: ../include/network-reset
+include: ../include/alice-port-vars
+include: ../include/bob-port-vars
+all: network zone new upl0 bridge
+all: network zone new upl1 bridge
+all: network zone new net0 bridge
+all: network zone new net1 bridge
+all: network zone upl0 port attach ${p_net1}
+all: network zone upl1 port attach ${p_net2}
+# Attach dummy ports to all net*
+all: network port new dummy
+all: network port new dummy
+all: network zone net0 port attach d0
+all: network zone net1 port attach d1
+# Bring everyting up
+all: network zone upl0 up
+all: network zone upl1 up
+all: network zone net0 up
+all: network zone net1 up
+all: network status
+# IP config
+alice: network zone upl0 config new static 192.168.122.2/24
+alice: network zone upl1 config new static 2001:470:6ef3:1::1/64
+alice: network zone net0 config new static 192.168.200.1/24
+alice: network zone net1 config new static 2001:470:6ef3::1/64
+bob: network zone upl0 config new static 192.168.122.3/24
+bob: network zone upl1 config new static 2001:470:6ef3:1::2/64
+bob: network zone net0 config new static 192.168.201.1/24
+bob: network zone net1 config new static 2001:470:6ef3:2::1/64
+# Simple ping test
+alice: ping -c 5 192.168.122.3
+alice: ping6 -c 5 2001:470:6ef3:1::1
+bob: ping -c 5 192.168.122.2
+bob: ping6 -c 5 2001:470:6ef3:1::2
\ No newline at end of file
diff --git a/test/nitsi/include/vpn-ipsec-basic-connection b/test/nitsi/include/vpn-ipsec-basic-connection
new file mode 100644 (file)
index 0000000..f5594fa
--- /dev/null
@@ -0,0 +1,5 @@
+# A basic vpn connection with some common config values set
+all: network vpn ipsec connection new basic
+all: network vpn ipsec connection basic authentication mode PSK
+all: network vpn ipsec connection basic authentication pre-shared-key "12345678"
+all: network vpn ipsec connection basic security-policy "system"
diff --git a/test/nitsi/include/vpn-ipsec-basic-peer-ipv4 b/test/nitsi/include/vpn-ipsec-basic-peer-ipv4
new file mode 100644 (file)
index 0000000..52c6d3f
--- /dev/null
@@ -0,0 +1,2 @@
+alice: network vpn ipsec connection basic peer 192.168.122.3
+bob: network vpn ipsec connection basic peer 192.168.122.2
\ No newline at end of file
diff --git a/test/nitsi/include/vpn-ipsec-basic-peer-ipv6 b/test/nitsi/include/vpn-ipsec-basic-peer-ipv6
new file mode 100644 (file)
index 0000000..9715e08
--- /dev/null
@@ -0,0 +1,2 @@
+alice: network vpn ipsec connection basic peer 2001:470:6ef3:1::2
+bob: network vpn ipsec connection basic peer 2001:470:6ef3:1::1
\ No newline at end of file
diff --git a/test/nitsi/include/vpn-ipsec-basic-ping-test-ipv4 b/test/nitsi/include/vpn-ipsec-basic-ping-test-ipv4
new file mode 100644 (file)
index 0000000..23d465c
--- /dev/null
@@ -0,0 +1,3 @@
+# This recipe tests if the vpn connection is working by pinging the remote subnet
+alice: ping -c 5 192.168.201.1
+bob: ping -c 5 192.168.200.1
\ No newline at end of file
diff --git a/test/nitsi/include/vpn-ipsec-basic-ping-test-ipv6 b/test/nitsi/include/vpn-ipsec-basic-ping-test-ipv6
new file mode 100644 (file)
index 0000000..c6d5e69
--- /dev/null
@@ -0,0 +1,3 @@
+# This recipe tests if the vpn connection is working by pinging the remote subnet
+alice: ping6 -c 5 2001:470:6ef3:2::1
+bob: ping6 -c 5 2001:470:6ef3::1
\ No newline at end of file
diff --git a/test/nitsi/include/vpn-ipsec-basic-ping-test-ipv64 b/test/nitsi/include/vpn-ipsec-basic-ping-test-ipv64
new file mode 100644 (file)
index 0000000..3d9dfff
--- /dev/null
@@ -0,0 +1,5 @@
+# This recipe tests if the vpn connection is working by pinging the remote subnet
+alice: ping -c 5 192.168.201.1
+bob: ping -c 5 192.168.200.1
+alice: ping6 -c 5 2001:470:6ef3:2::1
+bob: ping6 -c 5 2001:470:6ef3::1
\ No newline at end of file
diff --git a/test/nitsi/include/vpn-ipsec-basic-ts-ipv4 b/test/nitsi/include/vpn-ipsec-basic-ts-ipv4
new file mode 100644 (file)
index 0000000..34ed574
--- /dev/null
@@ -0,0 +1,4 @@
+alice: network vpn ipsec connection basic local prefix 192.168.200.0/24
+alice: network vpn ipsec connection basic remote prefix 192.168.201.0/24
+bob: network vpn ipsec connection basic local prefix 192.168.201.0/24
+bob: network vpn ipsec connection basic remote prefix 192.168.200.0/24
\ No newline at end of file
diff --git a/test/nitsi/include/vpn-ipsec-basic-ts-ipv6 b/test/nitsi/include/vpn-ipsec-basic-ts-ipv6
new file mode 100644 (file)
index 0000000..7f1bf74
--- /dev/null
@@ -0,0 +1,4 @@
+alice: network vpn ipsec connection basic local prefix 2001:470:6ef3::/64
+alice: network vpn ipsec connection basic remote prefix 2001:470:6ef3:2::/64
+bob: network vpn ipsec connection basic local prefix 2001:470:6ef3:2::/64
+bob: network vpn ipsec connection basic remote prefix 2001:470:6ef3::/64
\ No newline at end of file
diff --git a/test/nitsi/include/vpn-ipsec-basic-ts-ipv64 b/test/nitsi/include/vpn-ipsec-basic-ts-ipv64
new file mode 100644 (file)
index 0000000..7845bc6
--- /dev/null
@@ -0,0 +1,4 @@
+alice: network vpn ipsec connection basic local prefix 192.168.200.0/24 2001:470:6ef3::/64
+alice: network vpn ipsec connection basic remote prefix 192.168.201.0/24 2001:470:6ef3:2::/64
+bob: network vpn ipsec connection basic local prefix 192.168.201.0/24 2001:470:6ef3:2::/64
+bob: network vpn ipsec connection basic remote prefix 192.168.200.0/24 2001:470:6ef3::/64
\ No newline at end of file
diff --git a/test/nitsi/include/vpn-ipsec-basic-vti-test b/test/nitsi/include/vpn-ipsec-basic-vti-test
new file mode 100644 (file)
index 0000000..82ec708
--- /dev/null
@@ -0,0 +1,3 @@
+# Check that the package are routed through the vti device
+all: [[ 0 != $(cat /sys/class/net/ipsec-basic/statistics/tx_packets) ]]
+all: [[ 0 != $(cat /sys/class/net/ipsec-basic/statistics/rx_packets) ]]
\ No newline at end of file