aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qtip/cli/commands/cmd_project.py14
-rw-r--r--qtip/scripts/quickstart.sh8
-rw-r--r--resources/ansible_roles/qtip-generator/defaults/main.yml3
-rw-r--r--resources/ansible_roles/qtip-generator/files/compute/setup.yml2
-rwxr-xr-xtests/ci/experimental.sh6
-rwxr-xr-xtests/ci/periodic.sh4
6 files changed, 23 insertions, 14 deletions
diff --git a/qtip/cli/commands/cmd_project.py b/qtip/cli/commands/cmd_project.py
index 2836fa69..11fa63e5 100644
--- a/qtip/cli/commands/cmd_project.py
+++ b/qtip/cli/commands/cmd_project.py
@@ -59,7 +59,16 @@ def cli():
help='Host configured for ssh client or IP addresses and domain name')
@click.option('--scenario',
help='OPNFV scenario')
-def create(project_name, project_template, pod_name, installer_type, installer_host, scenario):
+@click.option('--sut',
+ prompt='System Under Test type',
+ help='Type of system can be vnf')
+def create(project_name,
+ project_template,
+ pod_name,
+ installer_type,
+ installer_host,
+ scenario,
+ sut):
qtip_generator_role = os.path.join(utils.QTIP_ANSIBLE_ROLES, 'qtip-generator')
extra_vars = {
'qtip_package': utils.QTIP_PACKAGE,
@@ -69,7 +78,8 @@ def create(project_name, project_template, pod_name, installer_type, installer_h
'pod_name': pod_name,
'installer_type': installer_type,
'installer_host': installer_host,
- 'scenario': scenario
+ 'scenario': scenario,
+ 'sut': sut
}
os.system("ANSIBLE_ROLES_PATH={roles_path} ansible-playbook"
" -i {hosts}"
diff --git a/qtip/scripts/quickstart.sh b/qtip/scripts/quickstart.sh
index b430aa3f..f9becda8 100644
--- a/qtip/scripts/quickstart.sh
+++ b/qtip/scripts/quickstart.sh
@@ -30,7 +30,7 @@ verify_connectivity(){
}
#Getoptions
-while getopts ":t:i:p:s:r:he" optchar; do
+while getopts ":t:i:p:s:r:u:he" optchar; do
case "${optchar}" in
q) test_suite=${OPTARG} ;;
t) installer_type=${OPTARG} ;;
@@ -38,6 +38,7 @@ while getopts ":t:i:p:s:r:he" optchar; do
p) pod_name=${OPTARG} ;;
s) scenario=${OPTARG} ;;
r) testapi_url=${OPTARG} ;;
+ u) sut=${OPTARG} ;;
h) usage
exit 0
;;
@@ -55,6 +56,7 @@ test_suite=${test_suite:-$TEST_SUITE}
pod_name=${pod_name:-$NODE_NAME}
scenario=${scenario:-$SCENARIO}
testapi_url=${testapi_url:-$TESTAPI_URL}
+sut=${sut:-host}
# we currently support fuel, apex and mcp
if [[ ! "$installer_type" =~ (fuel|apex|mcp) ]]; then
@@ -76,9 +78,9 @@ esac
cd /home/opnfv
qtip create --project-template ${test_suite} --pod-name ${pod_name} --installer-type ${installer_type} \
---installer-host ${installer_ip} --scenario ${scenario} ${test_suite}
+--installer-host ${installer_ip} --scenario ${scenario} --sut ${sut} ${test_suite}-${sut}
-cd ${test_suite}
+cd ${test_suite}-${sut}
qtip setup
eval `ssh-agent`
diff --git a/resources/ansible_roles/qtip-generator/defaults/main.yml b/resources/ansible_roles/qtip-generator/defaults/main.yml
index 300dadf0..6665d11f 100644
--- a/resources/ansible_roles/qtip-generator/defaults/main.yml
+++ b/resources/ansible_roles/qtip-generator/defaults/main.yml
@@ -26,6 +26,3 @@ project_template: 'compute'
qtip_package: ../../..
qtip_cache: .qtip-cache
cwd: .
-
-# TODO(zhihui) temporarily hardcode
-sut_type: vnf \ No newline at end of file
diff --git a/resources/ansible_roles/qtip-generator/files/compute/setup.yml b/resources/ansible_roles/qtip-generator/files/compute/setup.yml
index 10537615..037f5746 100644
--- a/resources/ansible_roles/qtip-generator/files/compute/setup.yml
+++ b/resources/ansible_roles/qtip-generator/files/compute/setup.yml
@@ -11,7 +11,7 @@
---
-{% if sut_type == 'vnf' %}
+{% if sut == 'vnf' %}
- hosts: localhost
gather_facts: no
roles:
diff --git a/tests/ci/experimental.sh b/tests/ci/experimental.sh
index e4bcc577..53de1db4 100755
--- a/tests/ci/experimental.sh
+++ b/tests/ci/experimental.sh
@@ -20,7 +20,6 @@ export CI_DEBUG='false'
export TEST_SUITE='compute'
export TESTAPI_URL=''
export SSH_CREDENTIALS='/root/.ssh'
-
export WORKSPACE=${WORKSPACE:-$(pwd)}
source ${script_dir}/utils/start_services.sh
@@ -31,7 +30,8 @@ qtip_repo='/home/opnfv/repos/qtip'
docker cp . ${TEST_SUITE}_qtip:${qtip_repo}
docker exec ${TEST_SUITE}_qtip bash -c "cd ${qtip_repo} && pip install -U -e ."
-docker exec ${TEST_SUITE}_qtip bash -x ${qtip_repo}/qtip/scripts/quickstart.sh
-echo "QTIP: Verify ${TEST_SUITE} done!"
+docker exec ${TEST_SUITE}_qtip bash -x ${qtip_repo}/qtip/scripts/quickstart.sh -u {SUT}
+
+echo "QTIP: Verify ${TEST_SUITE} on ${SUT} done!"
exit 0
diff --git a/tests/ci/periodic.sh b/tests/ci/periodic.sh
index 87fa7627..5bbdf517 100755
--- a/tests/ci/periodic.sh
+++ b/tests/ci/periodic.sh
@@ -13,8 +13,8 @@ script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${script_dir}/utils/start_services.sh
-docker exec ${TEST_SUITE}_qtip bash -x /home/opnfv/repos/qtip/qtip/scripts/quickstart.sh
+docker exec ${TEST_SUITE}_qtip bash -x /home/opnfv/repos/qtip/qtip/scripts/quickstart.sh -u ${SUT}
-echo "${TEST_SUITE} QPI done!"
+echo "${TEST_SUITE} QPI on ${SUT} done!"
exit 0