From ae7a79dae0518a09d68eb201f3cae9f07bc6e9ed Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 15 Sep 2018 22:57:09 +0100 Subject: [PATCH] nitsi: Add phase1 This is supposed to be a good base to build on for any test that needs a working layer 2 and some IP addresses on the network to reach any other machines Signed-off-by: Michael Tremer --- Makefile.am | 1 + test/nitsi/include/phase1 | 32 ++++++++++++++++++++++++++++++++ test/nitsi/test/phase1/recipe | 6 ++++++ test/nitsi/test/phase1/settings | 3 +++ 4 files changed, 42 insertions(+) create mode 100644 test/nitsi/include/phase1 create mode 100644 test/nitsi/test/phase1/recipe create mode 100644 test/nitsi/test/phase1/settings diff --git a/Makefile.am b/Makefile.am index 1f2dac64..36885083 100644 --- a/Makefile.am +++ b/Makefile.am @@ -599,6 +599,7 @@ CLEANFILES += \ NITSI_TESTS = \ test/nitsi/test/hello-world \ test/nitsi/test/make-check \ + test/nitsi/test/phase1 \ test/nitsi/test/raw-device-get-by-mac \ test/nitsi/test/zone-new-bridge \ test/nitsi/test/zone-port-attach-bridge diff --git a/test/nitsi/include/phase1 b/test/nitsi/include/phase1 new file mode 100644 index 00000000..8679131e --- /dev/null +++ b/test/nitsi/include/phase1 @@ -0,0 +1,32 @@ +# The file contains some basic setup that creates two zones +# and a couple of ports + +# This contains the basic network configuration for all vpn-tests +include: ../include/alice-port-vars +include: ../include/bob-port-vars + +# Create an uplink zone +all: network zone new upl0 bridge +all: network zone upl0 port attach ${p_net1} + +# Create a local zone +all: network zone new net0 bridge + +# Attach a dummy port to net0 +all: network port new dummy +all: network zone net0 port attach d0 + +# Add IP addresses for Alice +alice: network zone upl0 config new static 192.168.100.101/24 +alice: network zone upl0 config new static 2001:db8:100::101/64 +alice: network zone net0 config new static 192.168.200.1/24 +alice: network zone net0 config new static 2001:db8:200::1/64 + +# Add IP addresses for Bob +bob: network zone upl0 config new static 192.168.100.102/24 +bob: network zone upl0 config new static 2001:db8:100::102/64 +bob: network zone net0 config new static 192.168.201.1/24 +bob: network zone net0 config new static 2001:db8:201::1/64 + +# Print what has been brought up +all: network status diff --git a/test/nitsi/test/phase1/recipe b/test/nitsi/test/phase1/recipe new file mode 100644 index 00000000..61e27f3c --- /dev/null +++ b/test/nitsi/test/phase1/recipe @@ -0,0 +1,6 @@ +include: ../../include/setup +include: ../../include/phase1 + +# Let Alice ping Bob +alice: ping -c 5 192.168.100.102 +alice: ping6 -c 5 2001:db8:100::102 diff --git a/test/nitsi/test/phase1/settings b/test/nitsi/test/phase1/settings new file mode 100644 index 00000000..4757c7ad --- /dev/null +++ b/test/nitsi/test/phase1/settings @@ -0,0 +1,3 @@ +[GENERAL] +name = Validate Phase 1 +description = This test checks if phase 1 can be brought up -- 2.39.2