summaryrefslogtreecommitdiffstats
path: root/run_posca.sh
diff options
context:
space:
mode:
authoryuyang <Gabriel.yuyang@huawei.com>2017-02-06 16:21:36 +0800
committeryuyang <Gabriel.yuyang@huawei.com>2017-02-09 16:35:44 +0800
commit9038727dee2e67f8facd75f8b498ca20a1e066c9 (patch)
treedcf40ce6ee38d8d214345c6befefdd0fac973dbf /run_posca.sh
parent0a29e9ec59e21dc46db0497187cc9d0de0844b05 (diff)
Add POSCA jenkins job support
JIRA: BOTTLENECK-128 This patch is to make the POSCA testsuite could be built automatically for OPNFV CI job. Change-Id: I21d7fd553ce3591aea3391a33fe0a7b8579b57d4 Signed-off-by: yuyang <Gabriel.yuyang@huawei.com>
Diffstat (limited to 'run_posca.sh')
-rw-r--r--run_posca.sh54
1 files changed, 54 insertions, 0 deletions
diff --git a/run_posca.sh b/run_posca.sh
new file mode 100644
index 00000000..b47a220a
--- /dev/null
+++ b/run_posca.sh
@@ -0,0 +1,54 @@
+#!/bin/bash
+##############################################################################
+# Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+pip install -U /home/opnfv/bottlenecks
+
+function check_testcase(){
+
+ check_suite="$1"
+ SUITE_PREFIX="/home/opnfv/bottlenecks/testsuites/posca/testcase_cfg"
+
+ TEST_CASE=$2
+
+ #find all the test case yaml files first
+ find $SUITE_PREFIX -name "*yaml" > /tmp/all_testcases.yaml
+ all_testcases_insuite=`cat /tmp/all_testcases.yaml | awk -F '/' '{print $NF}' | awk -F '.' '{print $1}'`
+ all_testcases=(${all_testcases_insuite})
+
+ if [ "${TEST_CASE}" != "" ]; then
+ testcase_exec=(${TEST_CASE// /})
+ for i in "${testcase_exec[@]}"; do
+ if [[ " ${all_testcases[*]} " != *" $i "* ]]; then
+ error "unknown test case: $i. available test cases are: ${all_test_cases[@]}"
+ fi
+ done
+ info "tests to execute: ${TEST_CASE}."
+ else
+ error "lack of testcase name"
+ fi
+}
+
+SUITE_PREFIX="/home/opnfv/bottlenecks/testsuites/posca/testcase_cfg"
+source /home/opnfv/bottlenecks/common.sh
+test_file="/home/opnfv/bottlenecks/testsuites/posca/testsuite_story/posca_factor_test"
+if [[ -f $test_file ]]; then
+ testcases=($(cat $test_file))
+else
+ error "no posca test suite file "
+fi
+
+for i in "${testcases[@]}"; do
+ #check if the testcase is legal or not
+ check_testcase -posca $i
+ #adjust config parameters
+ #run test case
+ file=${SUITE_PREFIX}/${i}.yaml
+ python /home/opnfv/bottlenecks/testsuites/posca/run_posca.py
+done