rocker: add tests
PATCH 9/10 rocker: add tests
From: Scott Feldman <[email protected]>
Add some basic test for rocker to test L2/L3/L4 functionality. Requires an external test environment, simp, located here:
https://github.com/scottfeldman/simp
To run tests, simp environment must be installed and a suitable VM image built and installed with a Linux 3.18 (or greater) kernel with rocker driver support enabled.
Signed-off-by Scott Feldman <[email protected]>
--- hw/net/rocker/test/README | 5 +++ hw/net/rocker/test/all | 19 +++++++++++ hw/net/rocker/test/bridge | 43 ++++++++++++++++++++++++ hw/net/rocker/test/bridge-stp | 52 +++++++++++++++++++++++++++++ hw/net/rocker/test/bridge-vlan | 52 +++++++++++++++++++++++++++++ hw/net/rocker/test/bridge-vlan-stp | 64 ++++++++++++++++++++++++++++++++++++ hw/net/rocker/test/port | 22 +++++++++++++ hw/net/rocker/test/tut.dot | 8 +++++ 8 files changed, 265 insertions(+) create mode 100644 hw/net/rocker/test/README create mode 100755 hw/net/rocker/test/all create mode 100755 hw/net/rocker/test/bridge create mode 100755 hw/net/rocker/test/bridge-stp create mode 100755 hw/net/rocker/test/bridge-vlan create mode 100755 hw/net/rocker/test/bridge-vlan-stp create mode 100755 hw/net/rocker/test/port create mode 100644 hw/net/rocker/test/tut.dot
hw/net/rocker/test/README new file +5 -0
@@ -0,0 +1,5 @@ +Tests require simp (simple network simulator) found here: + +https://github.com/scottfeldman/simp + +Run 'all' to run all tests.
hw/net/rocker/test/all new file +19 -0
@@ -0,0 +1,19 @@ +echo -n "Running port test... " +./port +if [ $? -eq 0 ]; then echo "pass"; else echo "FAILED"; exit 1; fi + +echo -n "Running bridge test... " +./bridge +if [ $? -eq 0 ]; then echo "pass"; else echo "FAILED"; exit 1; fi + +echo -n "Running bridge STP test... " +./bridge-stp +if [ $? -eq 0 ]; then echo "pass"; else echo "FAILED"; exit 1; fi + +echo -n "Running bridge VLAN test... " +./bridge-vlan +if [ $? -eq 0 ]; then echo "pass"; else echo "FAILED"; exit 1; fi + +echo -n "Running bridge VLAN STP test... " +./bridge-vlan-stp +if [ $? -eq 0 ]; then echo "pass"; else echo "FAILED"; exit 1; fi
hw/net/rocker/test/bridge new file +43 -0
43 lines not on this page · raw message
hw/net/rocker/test/bridge-stp new file +52 -0
52 lines not on this page · raw message
hw/net/rocker/test/bridge-vlan new file +52 -0
52 lines not on this page · raw message
hw/net/rocker/test/bridge-vlan-stp new file +64 -0
64 lines not on this page · raw message
hw/net/rocker/test/port new file +22 -0
@@ -0,0 +1,22 @@ +simp destroy ".*" +simp create -o sw1:rocker:sw1 tut tut.dot +simp start tut +while ! simp ssh tut sw1 --cmd "ping -c 1 localhost >/dev/null"; do sleep 1; done +while ! simp ssh tut h1 --cmd "ping -c 1 localhost >/dev/null"; do sleep 1; done +while ! simp ssh tut h2 --cmd "ping -c 1 localhost >/dev/null"; do sleep 1; done + +# bring up DUT ports + +simp ssh tut sw1 --cmd "sudo ifconfig swp1 11.0.0.1/24" +simp ssh tut sw1 --cmd "sudo ifconfig swp2 12.0.0.1/24" + +# config IP on hosts + +simp ssh tut h1 --cmd "sudo ifconfig swp1 11.0.0.2/24" +simp ssh tut h2 --cmd "sudo ifconfig swp1 12.0.0.2/24" + +# test... + +simp ssh tut h1 --cmd "ping -c10 11.0.0.1 >/dev/null" +if [ $? -eq 1 ]; then exit 1; fi +simp ssh tut h2 --cmd "ping -c10 12.0.0.1 >/dev/null"
hw/net/rocker/test/tut.dot new file +8 -0
@@ -0,0 +1,8 @@ +graph G { + graph [hostidtype="hostname", version="1:0", date="04/12/2013"]; + edge [dir=none, notify="log"]; + sw1:swp1 -- h1:swp1; + sw1:swp2 -- h2:swp1; + sw1:swp3 -- h3:swp1; + sw1:swp4 -- h4:swp1; +}
Signature · 1 line
1.7.10.4