summaryrefslogtreecommitdiffstats
path: root/Testcases/RunTests.sh
diff options
context:
space:
mode:
authorStuart Mackie <wsmackie@juniper.net>2016-01-29 16:00:57 -0800
committerStuart Mackie <wsmackie@juniper.net>2016-01-29 16:00:57 -0800
commit82f1a7eb5535b30a95b1e71ff18c315d40d1e6f0 (patch)
treef930c90f75846ec8d8e33cf27325ff8fafc85d5c /Testcases/RunTests.sh
parent5c04f2e22eb6b5e7a671bc02ba53a438eb66e90d (diff)
OpenContrail test suitestable/colorado
Change-Id: I61168093a2a05d47377ef47c8638ae1554b1a999 Signed-off-by: Stuart Mackie <wsmackie@juniper.net>
Diffstat (limited to 'Testcases/RunTests.sh')
-rwxr-xr-xTestcases/RunTests.sh137
1 files changed, 112 insertions, 25 deletions
diff --git a/Testcases/RunTests.sh b/Testcases/RunTests.sh
index 2982c4e..4c57ae8 100755
--- a/Testcases/RunTests.sh
+++ b/Testcases/RunTests.sh
@@ -1,38 +1,125 @@
#!/bin/bash
+# FUNCTEST_REPO_DIR=/tmp
+# Setup environment
+export IMAGE_DIR="$FUNCTEST_REPO_DIR/ovno/images"
+export TESTCASE_DIR="$FUNCTEST_REPO_DIR/ovno/Testcases"
+export CIRROS_IMAGE=Cirros.img
+export FW_IMAGE="$FUNCTEST_REPO_DIR/ovno/images/OpenWRT-LRM--fw-v3.img"
+export RESULTS_DIR="$FUNCTEST_REPO_DIR/ovno/Testresults/results.`date +%Y-%m-%d:%H:%M:%S`"
+export RESULTS_FILE="$RESULTS_DIR/ocl_results"
+export ERR_FILE="$RESULTS_DIR/ocl__err"
+export TEST_ERR=/tmp/test_err
+mkdir -p $RESULTS_DIR
-PATH=$(repo_dir)/ovno/Testcases:$PATH
-cd $(repo_dir)/home/opnfv/ovno/Testcases
-# Create the config wrapper
-OCL_IP=`echo $OS_AUTH_URL | cut -d "/" -f3 | cut -d ":" -f1`
+check_test(){
+echo $test_desc
+if [ $($test > $TEST_ERR) ]
+then
+ echo "Success $test_name" >> $RESULTS_FILE
+else
+ echo "FAIL $test_name" >> $ERR_FILE
+ cat $TEST_ERR >> $ERR_FILE
+fi
+}
+#------------------------------------------------------------------------------#
+# Go to the where the scripts are
-cat <<EOF >config
-#!/usr/bin/python
+cd $TESTCASE_DIR
-import sys
-import os
-from config_shell import *
-default_client_args = [
- ('--username', 'admin'),
- ('--password', os.environ["OS_PASSWORD"]),
- ('--region', 'RegionOne'),
- ('--tenant', 'admin'),
- ('--api-server', os.environ["OCL_IP"])]
+export API_IP=`echo $OS_AUTH_URL | cut -d'/' -f3`
+export PATH=.:$PATH
-if __name__ == '__main__':
- for arg in default_client_args:
- if not arg[0] in sys.argv:
- sys.argv.insert(1, arg[0])
- sys.argv.insert(2, arg[1])
- ConfigShell().main()
+mkdir $LOG_DIR
+
+#___________________________________________________________________
+#Load images into OpenStack
+
+
+# Get the Cirros image onto jump/test server, then load into OpenStack
+glance image-create --name Cirros --file $IMAGE_DIR/$CIRROS_IMAGE --disk-format qcow2 --container-format bare --owner $TENANT_ID
+
+# Get firewall image
+glance image-create --name fw --file $IMAGE_DIR/$FW_IMAGE --disk-format qcow2 --container-format bare --owner $TENANT_ID
+
+
+export NET1="192.168.1.0/24"
+export NET2="192.168.2.0/24"
+export NET3="192.168.3.0/24"
+export NET_PUBLIC="10.8.10.0/24"
+
+
+# Set up the test list
+cat<<EOF | sed -e "/#/d" > Test_V4
+Add IP address manager|add_ipam|config add ipam ipam
+Add network Net1|add_network_Net1|config add network N1 --ipam ipam --subnet $NET1
+Add VM V11|add_VM_V11|config add vm V11 --image Cirros --flavor m1.tiny --network Net1
+Add VM V12|add_VM_V12|config add vm V12 --image Cirros --flavor m1.tiny --network Net1
+#Check V11 to V12 connectivity!! Still to be implemented !!
+Add policy Net2-Net3|add_plcy_Net2-Net3|config add policy Net2-Net3 --rule src-net=Net1,dst-net=Net2config add network Net2 --ipam ipam --subnet 192.168.2.0/24 --policy Net2-Net3
+Add network Net2|add_net_Net2|config add network Net2 --ipam ipam --subnet 192.168.2.0/24 --policy Net2-Net3
+Add network Net3|add_net_Net3|config add network Net3 --ipam ipam --subnet 192.168.2.0/24 --policy Net2-Net3
+Add VM V21|add_VM_VM21|config add vm V21 --image Cirros --flavor m1.tiny --network Net2
+Add VM V31|add_VM_VM31|config add vm V31 --image Cirros --flavor m1.tiny --network Net3
+#Check V21 to V31 connectivity !! Still to be implemented !!
+Add svc tmplt fw-l3|add_ST_fw-l3|config add service-template fw-l3 --mode in-network --type firewall --image fw --flavor m1.medium --interface left --interface right --interface management
+Add service inst fw|add_svc_fw|config add service-instance fw --template fw-l3 --network network=left,tenant=$TENANT --network network=right,tenant=$TENANT --network=auto,tenant=$TENANT
+Add svc chain policy|add_svc_chain_plcy|config add policy left-right --rule src-net=left,dst-net=right --action service --service fw
+Add network left|add_network_left|config add network left --ipam ipam --subnet $NET2 --policy left-right
+Add network right|add_network_right|config add network right --ipam ipam --subnet $NET3 --policy left-right
+Add VM VL1|add_VM_VL1|config add vm VL1 --image Cirros --flavor m1.tiny --network left
+Add VM VR1|add_VM_VR1|config add vm VR1 --image Cirros --flavor m1.tiny --network right
+#Check V21 to V31 connectivity !! Still to be implemented !!
+Add network public|add_net_public|config add network public --ipam ipam-default --sbunet $NET_PUBLIC --route-target 64512:10000
+Add floating IP pool|add_float_ip_pool|config add floating-ip-pool public-pool --network public
+Add floating IP to VM|add_float_ip_vm|config add vm-interface server|V11 --floating-ip --floating-ip-pool public-pool
+# Check external connectivity to V11 !! Still to be implemented !!
+Clean up v4|clean_up_v4|cleanup v4
EOF
-chmod 777 config
+while IFS='|' read test_desc test_name test
+do
+ check_test
+done <Test_V4
+# IPv6 tests
+export NET1="xx"
+export NET2="yy"
+export NET3="zz"
+export NET_PUBLIC="aa"
+
+cat<<EOF | sed -e "/#/d" > Test_V6
+V6 IP V6ress manager|V6_ipam|config add ipam ipam
+V6 network Net1|V6_network_Net1|config add network N1 --ipam ipam --subnet $NET1
+V6 VM V11|V6_VM_V11|config add vm V11 --image Cirros --flavor m1.tiny --network Net1
+V6 VM V12|V6_VM_V12|config add vm V12 --image Cirros --flavor m1.tiny --network Net1
+# Check V11 to V12 connectivity!! Still to be implemented !!
+V6 policy Net2-Net3|V6_plcy_Net2-Net3| config add policy Net2-Net3 --rule src-net=Net1,dst-net=Net2config V6 network Net2 --ipam ipam --subnet 192.168.2.0/24 --policy Net2-Net3
+V6 network Net2|V6_net_Net2|config add network Net2 --ipam ipam --subnet 192.168.2.0/24 --policy Net2-Net3
+V6 network Net3|V6_net_Net3|config add network Net3 --ipam ipam --subnet 192.168.2.0/24 --policy Net2-Net3
+V6 VM V21|V6_VM_VM21|config add vm V21 --image Cirros --flavor m1.tiny --network Net2
+V6 VM V31|V6_VM_VM31|config add vm V31 --image Cirros --flavor m1.tiny --network Net3
+# Check V21 to V31 connectivity !! Still to be implemented !!
+V6 svc tmplt fw-l3|V6_ST_fw-l3|config add service-template fw-l3 --mode in-network --type firewall --image fw --flavor m1.medium --interface left --interface right --interface management
+V6 service inst fw|V6_svc_fw|config add service-instance fw --template fw-l3 --network network=left,tenant=$TENANT --network network=right,tenant=$TENANT --network=auto,tenant=$TENANT
+V6 svc chain policy|V6_svc_chain_plcy|config add policy left-right --rule src-net=left,dst-net=right --action service --service fw
+V6 network left|V6_network_left|config add network left --ipam ipam --subnet $NET2 --policy left-right
+V6 network right|V6_network_right|config add network right --ipam ipam --subnet $NET3 --policy left-right
+V6 VM VL1|V6_VM_VL1|config add vm VL1 --image Cirros --flavor m1.tiny --network left
+V6 VM VR1|V6_VM_VR1|config add vm VR1 --image Cirros --flavor m1.tiny --network right
+# Check V21 to V31 connectivity !! Still to be implemented !!
+V6 network public|V6_net_public|config add network public --ipam ipam-default --sbunet $NET_PUBLIC --route-target 64512:10000
+V6 floating IP pool|V6_float_ip_pool|config add floating-ip-pool public-pool --network public
+V6 floating IP to VM|V6_float_ip_vm|config add vm-interface server|V11 --floating-ip --floating-ip-pool public-pool
+# Check external connectivity to V11 !! Still to be implemented !!
+Clean up v6|clean_up_v6|cleanup v6
+EOF
+while IFS='|' read test_desc test_name test
+do
+ check_test
+done <Test_V6
-echo "Starting OpenContrail test suite"
-# Tests go here
-echo "Finished OpenContrail test suite"
+# After this send results to database