aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve McIntyre <steve.mcintyre@linaro.org>2015-07-31 15:33:37 +0100
committerSteve McIntyre <steve.mcintyre@linaro.org>2015-07-31 15:33:37 +0100
commit7f17ca15ba7a2508cf2a52e6590c4928e70614b8 (patch)
tree49365e4ce31d877f11a1c651558e8ef87e8cbf61
parent562cedab3af7ec7e0896246a957df4008b30e166 (diff)
Add new massive test setup with all 10 hosts
5 VLANs, spread across 5 switches Change-Id: I3ab7ed68eec8cedf7ca38f5b0c57cb2076ce28a5
-rw-r--r--test/complex-5switches-5vlans-1188
1 files changed, 188 insertions, 0 deletions
diff --git a/test/complex-5switches-5vlans-1 b/test/complex-5switches-5vlans-1
new file mode 100644
index 0000000..cdb0a37
--- /dev/null
+++ b/test/complex-5switches-5vlans-1
@@ -0,0 +1,188 @@
+#!/bin/bash
+#
+# More complex VLANd test script
+
+set -e
+
+NAME="complex-5switches-5vlans-1"
+
+DESCRIPTION="Check VLAN isolation for 10 machines in 5 VLANs scattered across multiple switches."
+
+# List all the switches and hosts we need to use, if not using all of
+# them. We can make tests run faster by not involving *all* of them in
+# every test.
+HOSTS="imx5301 imx5302 imx5303"
+HOSTS="$HOSTS panda01 panda02 panda03"
+HOSTS="$HOSTS arndale01 arndale02 arndale03 arndale04"
+
+#SWITCHES="vlandswitch05" # Let the system work things out
+
+# Show more detail during test output
+VERBOSE=0
+
+# And give a filename for logging
+LOGFILE=$0-$$.log
+
+# Include the core test wrapper code that makes life easier
+DIR=$(dirname $0)
+. ${DIR}/test-common
+
+# Ensure all the ports we're using are on their base VLANs
+log "checking base VLANs"
+verify_all_hosts_are_base
+log "$HOSTS are all on their base VLANs - good"
+
+# Clear old logfiles from our test machines
+stop_logging
+clear_logs
+
+# Start all the test machines logging, then wait 60s to let all of
+# them show baseline results before we start testing
+start_logging
+log "CHECK INIT START"
+log "CHECK INIT CHECK VLAN_BASE:imx5301:imx5302:imx5303:panda01:panda02:panda03:arndale01:arndale02:arndale03:arndale04"
+pause 60
+log "CHECK INIT END"
+
+# Create 2 VLANs: tag 30, named "test30" and tag 31, named "test31"
+log "Creating new VLAN tag 30"
+OUTPUT=$(run_admin_command --create_vlan test30 30 false)
+VLAN_ID1=$(run_admin_command --lookup_vlan_by_tag 30)
+log "Creating new VLAN tag 31"
+OUTPUT=$(run_admin_command --create_vlan test31 31 false)
+VLAN_ID2=$(run_admin_command --lookup_vlan_by_tag 31)
+log "Creating new VLAN tag 32"
+OUTPUT=$(run_admin_command --create_vlan test32 32 false)
+VLAN_ID3=$(run_admin_command --lookup_vlan_by_tag 32)
+log "Creating new VLAN tag 33"
+OUTPUT=$(run_admin_command --create_vlan test33 33 false)
+VLAN_ID4=$(run_admin_command --lookup_vlan_by_tag 33)
+log "Creating new VLAN tag 34"
+OUTPUT=$(run_admin_command --create_vlan test34 34 false)
+VLAN_ID5=$(run_admin_command --lookup_vlan_by_tag 34)
+
+log "Created new VLANs with IDs $VLAN_ID1, $VLAN_ID2, $VLAN_ID3, $VLAN_ID4 and $VLAN_ID5"
+
+# Wait 10s for everything to settle
+pause 10
+
+# Move some of the test machines to these new VLANs, pausing at each
+# setup
+log "Moving panda01 to VLAN ID $VLAN_ID1"
+OUTPUT=$(run_admin_command --set_port_current_vlan ${panda01_PORT_ID} $VLAN_ID1)
+log "Moving panda02 to VLAN ID $VLAN_ID1"
+OUTPUT=$(run_admin_command --set_port_current_vlan ${panda02_PORT_ID} $VLAN_ID1)
+log "Done moving ports to VLAN ID $VLAN_ID1"
+pause 60
+log "CHECK STEP1 START"
+log "CHECK STEP1 CHECK VLAN_30:panda01:panda02"
+log "CHECK STEP1 CHECK VLAN_BASE:imx5301:imx5302:imx5303:panda03:arndale01:arndale02:arndale03:arndale04"
+pause 60
+log "CHECK STEP1 END"
+
+log "Moving panda03 to VLAN ID $VLAN_ID2"
+OUTPUT=$(run_admin_command --set_port_current_vlan ${panda03_PORT_ID} $VLAN_ID2)
+log "Moving imx5303 to VLAN ID $VLAN_ID2"
+OUTPUT=$(run_admin_command --set_port_current_vlan ${imx5303_PORT_ID} $VLAN_ID2)
+log "Done moving ports to VLAN ID $VLAN_ID2"
+pause 60
+log "CHECK STEP2 START"
+log "CHECK STEP2 CHECK VLAN_30:panda01:panda02"
+log "CHECK STEP2 CHECK VLAN_31:panda03:imx5303"
+log "CHECK STEP2 CHECK VLAN_BASE:imx5301:imx5302:arndale01:arndale02:arndale03:arndale04"
+pause 60
+log "CHECK STEP2 END"
+
+log "Moving imx5301 to VLAN ID $VLAN_ID3"
+OUTPUT=$(run_admin_command --set_port_current_vlan ${imx5301_PORT_ID} $VLAN_ID3)
+log "Moving arndale03 to VLAN ID $VLAN_ID3"
+OUTPUT=$(run_admin_command --set_port_current_vlan ${arndale03_PORT_ID} $VLAN_ID3)
+log "Done moving ports to VLAN ID $VLAN_ID3"
+pause 60
+log "CHECK STEP3 START"
+log "CHECK STEP3 CHECK VLAN_30:panda01:panda02"
+log "CHECK STEP3 CHECK VLAN_31:panda03:imx5303"
+log "CHECK STEP3 CHECK VLAN_32:imx5301:arndale03"
+log "CHECK STEP3 CHECK VLAN_BASE:imx5302:arndale01:arndale02:arndale04"
+pause 60
+log "CHECK STEP3 END"
+
+log "Moving arndale01 to VLAN ID $VLAN_ID4"
+OUTPUT=$(run_admin_command --set_port_current_vlan ${arndale01_PORT_ID} $VLAN_ID4)
+log "Moving arndale04 to VLAN ID $VLAN_ID4"
+OUTPUT=$(run_admin_command --set_port_current_vlan ${arndale04_PORT_ID} $VLAN_ID4)
+log "Done moving ports to VLAN ID $VLAN_ID4"
+pause 60
+log "CHECK STEP4 START"
+log "CHECK STEP4 CHECK VLAN_30:panda01:panda02"
+log "CHECK STEP4 CHECK VLAN_31:panda03:imx5303"
+log "CHECK STEP4 CHECK VLAN_32:imx5301:arndale03"
+log "CHECK STEP4 CHECK VLAN_33:arndale01:arndale04"
+log "CHECK STEP4 CHECK VLAN_BASE:imx5302:arndale02"
+pause 60
+log "CHECK STEP4 END"
+
+log "Moving imx5302 to VLAN ID $VLAN_ID5"
+OUTPUT=$(run_admin_command --set_port_current_vlan ${imx5302_PORT_ID} $VLAN_ID5)
+log "Moving arndale02 to VLAN ID $VLAN_ID5"
+OUTPUT=$(run_admin_command --set_port_current_vlan ${arndale02_PORT_ID} $VLAN_ID5)
+log "Done moving ports to VLAN ID $VLAN_ID4"
+pause 60
+log "CHECK STEP5 START"
+log "CHECK STEP5 CHECK VLAN_30:panda01:panda02"
+log "CHECK STEP5 CHECK VLAN_31:panda03:imx5303"
+log "CHECK STEP5 CHECK VLAN_32:imx5301:arndale03"
+log "CHECK STEP5 CHECK VLAN_33:arndale01:arndale04"
+log "CHECK STEP5 CHECK VLAN_34:imx5302:arndale02"
+pause 60
+log "CHECK STEP5 END"
+
+
+# Move test machines back to their base VLANs
+log "Moving ports back to base"
+OUTPUT=$(run_admin_command --restore_port_to_base_vlan ${imx5301_PORT_ID})
+OUTPUT=$(run_admin_command --restore_port_to_base_vlan ${imx5302_PORT_ID})
+OUTPUT=$(run_admin_command --restore_port_to_base_vlan ${imx5303_PORT_ID})
+OUTPUT=$(run_admin_command --restore_port_to_base_vlan ${panda01_PORT_ID})
+OUTPUT=$(run_admin_command --restore_port_to_base_vlan ${panda02_PORT_ID})
+OUTPUT=$(run_admin_command --restore_port_to_base_vlan ${panda03_PORT_ID})
+OUTPUT=$(run_admin_command --restore_port_to_base_vlan ${arndale01_PORT_ID})
+OUTPUT=$(run_admin_command --restore_port_to_base_vlan ${arndale02_PORT_ID})
+OUTPUT=$(run_admin_command --restore_port_to_base_vlan ${arndale03_PORT_ID})
+OUTPUT=$(run_admin_command --restore_port_to_base_vlan ${arndale04_PORT_ID})
+log "Done moving ports back to base"
+
+# Wait 60s for everything to settle
+pause 60
+
+log "CHECK FINI START"
+log "CHECK FINI CHECK VLAN_BASE:imx5301:imx5302:imx5303:panda01:panda02:panda03:arndale01:arndale02:arndale03:arndale04"
+pause 60
+log "CHECK FINI END"
+
+# Check that they're all back on their base VLANs
+log "Checking base VLANs after the test"
+verify_all_hosts_are_base
+
+log "Delete the test VLANs"
+OUTPUT=$(run_admin_command --delete_vlan ${VLAN_ID1})
+OUTPUT=$(run_admin_command --delete_vlan ${VLAN_ID2})
+OUTPUT=$(run_admin_command --delete_vlan ${VLAN_ID3})
+OUTPUT=$(run_admin_command --delete_vlan ${VLAN_ID4})
+OUTPUT=$(run_admin_command --delete_vlan ${VLAN_ID5})
+
+# Stop all the test machines logging (and wait 60s)
+stop_logging
+pause 20
+
+log "Test done, grab logs"
+# Grab logs from the machines
+grab_logs >> $LOGFILE
+
+# Clear old logs
+clear_logs
+
+# How did the test do?
+check_test_steps
+
+# DONE!