diff options
author | Steve McIntyre <steve.mcintyre@linaro.org> | 2015-01-26 16:17:38 +0000 |
---|---|---|
committer | Steve McIntyre <steve.mcintyre@linaro.org> | 2015-01-26 16:17:38 +0000 |
commit | 4c2c601d54d92270bec526bbaff59c2723c2c8fc (patch) | |
tree | 02d12d3cbb50aaf59f8716c46455df91986cc34c /test/test-common | |
parent | ae2d0d802857ea6f84b8e388d3201142482c6b3b (diff) |
Test wrapper to be included in all tests
This works out from vland what all the IDs are for all the switches,
ports, VLANs etc. so that we can use common defs in the tests
themselves
Change-Id: Ibf71166555d60c2b2da0a4ea22e683dc580036f7
Diffstat (limited to 'test/test-common')
-rwxr-xr-x | test/test-common | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/test-common b/test/test-common new file mode 100755 index 0000000..f85661c --- /dev/null +++ b/test/test-common @@ -0,0 +1,39 @@ +# +# test-common +# +# Common set of definitions and functions to help with driving VLANd +# in testing + +echo $0 +TOPDIR=$(dirname $0)/.. +ADMIN="python $TOPDIR/admin.py" + +# Topology definitions +PAN1_SWITCH_PORT="Gi1/0/2" +PAN2_SWITCH_PORT="fa25" +PAN3_SWITCH_PORT="gi25" +ARN1_SWITCH_PORT="Gi1/0/3" +ARN2_SWITCH_PORT="fa2" +ARN3_SWITCH_PORT="gi2" +IMX1_SWITCH_PORT="Gi1/0/4" +IMX1_SWITCH_PORT="fa26" +IMX1_SWITCH_PORT="gi26" + +# Startup check +$ADMIN --status + +# Preload some data - what are the switch IDs and port IDs of the +# various things in our test setup? +SW1_ID=$($ADMIN --lookup_switch_by_name vlandswitch01) +SW2_ID=$($ADMIN --lookup_switch_by_name vlandswitch02) +SW3_ID=$($ADMIN --lookup_switch_by_name vlandswitch03) + +PAN1_PORT_ID=$($ADMIN --lookup_port_by_switch_and_name $SW1_ID $PAN1_SWITCH_PORT) +PAN2_PORT_ID=$($ADMIN --lookup_port_by_switch_and_name $SW2_ID $PAN2_SWITCH_PORT) +PAN2_PORT_ID=$($ADMIN --lookup_port_by_switch_and_name $SW3_ID $PAN3_SWITCH_PORT) +ARN1_PORT_ID=$($ADMIN --lookup_port_by_switch_and_name $SW1_ID $ARN1_SWITCH_PORT) +ARN2_PORT_ID=$($ADMIN --lookup_port_by_switch_and_name $SW2_ID $ARN2_SWITCH_PORT) +ARN3_PORT_ID=$($ADMIN --lookup_port_by_switch_and_name $SW2_ID $ARN3_SWITCH_PORT) +IMX1_PORT_ID=$($ADMIN --lookup_port_by_switch_and_name $SW1_ID $IMX1_SWITCH_PORT) +IMX2_PORT_ID=$($ADMIN --lookup_port_by_switch_and_name $SW2_ID $IMX3_SWITCH_PORT) +IMX3_PORT_ID=$($ADMIN --lookup_port_by_switch_and_name $SW2_ID $IMX3_SWITCH_PORT) |