aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSteve McIntyre <steve.mcintyre@linaro.org>2015-07-31 14:51:10 +0100
committerSteve McIntyre <steve.mcintyre@linaro.org>2015-07-31 14:51:10 +0100
commit562cedab3af7ec7e0896246a957df4008b30e166 (patch)
tree1a54cc4a4bf949e181d85d0481ee08f1331e3e99 /test
parent0b7cce10df58fe69f1c4a8159eb00449a5bb480b (diff)
Add another 3-switch test, now including the TP-Link
Change-Id: Ib592545e125561af707c72d6e308e20f2b5c71fd
Diffstat (limited to 'test')
-rw-r--r--test/medium-3switches-1vlan-2111
1 files changed, 111 insertions, 0 deletions
diff --git a/test/medium-3switches-1vlan-2 b/test/medium-3switches-1vlan-2
new file mode 100644
index 0000000..1b61570
--- /dev/null
+++ b/test/medium-3switches-1vlan-2
@@ -0,0 +1,111 @@
+#!/bin/bash
+#
+# VLANd test script
+
+set -e
+
+NAME="medium-3switches-1vlan-2"
+
+DESCRIPTION="Check VLAN interoperability for 3 machines on 3 different switches, with an observer on a different switch left on the default VLAN"
+
+# 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="imx5303 arndale03 imx5301" # The machines which will be moved
+ # to the test VLAN
+
+HOSTS="$HOSTS arndale01" # And add another which will stay on
+ # the base VLAN as an observer
+
+#SWITCHES= # We don't know which switches we're using
+ # for the test, so let the test wrapper
+ # work it 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:imx5303:arndale03:imx5301:arndale01"
+pause 60
+log "CHECK INIT END"
+
+# Create a VLAN with tag 30, named "test30"
+log "Creating new VLAN tag 30"
+OUTPUT=$(run_admin_command --create_vlan test30 30 false)
+VLAN_ID=$(run_admin_command --lookup_vlan_by_tag 30)
+log "Created new VLAN with ID $VLAN_ID"
+
+# Wait 10s for everything to settle
+pause 10
+
+# Move some of the test machines to this new VLAN
+log "Moving ports to VLAN ID $VLAN_ID"
+OUTPUT=$(run_admin_command --set_port_current_vlan ${imx5303_PORT_ID} $VLAN_ID)
+OUTPUT=$(run_admin_command --set_port_current_vlan ${arndale03_PORT_ID} $VLAN_ID)
+OUTPUT=$(run_admin_command --set_port_current_vlan ${imx5301_PORT_ID} $VLAN_ID)
+log "Done moving ports to VLAN ID $VLAN_ID"
+
+# Wait 60s for everything to settle and logs to show it again
+pause 60
+
+log "CHECK STEP1 START"
+log "CHECK STEP1 CHECK VLAN_30:imx5303:arndale03:imx5301"
+pause 60
+log "CHECK STEP1 END"
+
+# Move test machines back to their base VLANs
+log "Moving ports back to base"
+OUTPUT=$(run_admin_command --restore_port_to_base_vlan ${imx5303_PORT_ID})
+OUTPUT=$(run_admin_command --restore_port_to_base_vlan ${arndale03_PORT_ID})
+OUTPUT=$(run_admin_command --restore_port_to_base_vlan ${imx5301_PORT_ID})
+log "Done moving ports back to base"
+
+# Wait 30s for everything to settle
+pause 30
+
+log "CHECK FINI START"
+log "CHECK FINI CHECK VLAN_BASE:imx5303:arndale03:imx5301:arndale01"
+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 VLAN"
+OUTPUT=$(run_admin_command --delete_vlan ${VLAN_ID})
+
+# Stop all the test machines logging (and wait 20s for things to
+# recover and get logged)
+stop_logging
+pause 20
+
+# Grab logs from the machines
+grab_logs >> $LOGFILE
+
+# Clear old logs
+clear_logs
+
+# How did the test do?
+check_test_steps
+
+# DONE!