summaryrefslogtreecommitdiffstats
path: root/tests/functest_run.sh
diff options
context:
space:
mode:
authorshangxdy <shang.xiaodong@zte.com.cn>2018-03-20 11:24:38 +0800
committershangxdy <shang.xiaodong@zte.com.cn>2018-03-20 12:34:30 +0800
commit2fb1e566b5cf237b17619519746b066614719c23 (patch)
treefeeb91f3266985d62e9aeebedf41e36f77d16840 /tests/functest_run.sh
parent81b39e4d122c1a7566d02348e4d62c882ef4a9aa (diff)
Handle flavor before image
JIRA: PARSER-174 Change-Id: I891398e634846db617081b0baed9adf0662743b7 Signed-off-by: shangxdy <shang.xiaodong@zte.com.cn>
Diffstat (limited to 'tests/functest_run.sh')
-rwxr-xr-xtests/functest_run.sh20
1 files changed, 14 insertions, 6 deletions
diff --git a/tests/functest_run.sh b/tests/functest_run.sh
index c85219e..3f7656c 100755
--- a/tests/functest_run.sh
+++ b/tests/functest_run.sh
@@ -74,6 +74,18 @@ download_parser_image() {
}
register_parser_image_and_flavor() {
+
+ echo ""
+ [[ ! $(openstack ${debug} flavor show ${VM_FLAVOR_NAME}) ]] && {
+ echo " Create default flavor ${VM_FLAVOR_NAME}..."
+ openstack ${debug} flavor create --ram ${VM_FLAVOR_RAM} \
+ --vcpus ${VM_FLAVOR_CPUS} \
+ --disk ${VM_FLAVOR_DISK} \
+ ${VM_FLAVOR_NAME}
+ } || {
+ echo " Default flavor ${VM_FLAVOR_NAME} already exsits."
+ }
+
openstack ${debug} image list | grep -qwo "${PARSER_IMAGE_NAME}" && {
echo " Image ${PARSER_IMAGE_NAME} has bee registed, needn't registe again."
return 0
@@ -87,11 +99,6 @@ register_parser_image_and_flavor() {
--container-format bare \
--file ${PARSER_IMAGE_FILE}
- [[ ! openstack flavor show ${VM_FLAVOR_NAME} ]] && {
- echo " Create default flavor ${VM_FLAVOR_NAME}..."
- openstack flavor create --ram ${VM_FLAVOR_RAM} \
- --vcpus ${VM_FLAVOR_CPUS} --disk ${VM_FLAVOR_DISK} ${VM_FLAVOR_NAM}
- }
}
create_parser_user_and_project() {
@@ -186,8 +193,9 @@ translator_and_deploy_vRNC() {
# 1. Delete parser stack ${PARSER_STACK_NAME}, use admin user in admin project
openstack ${debug} stack list | grep -qow ${PARSER_STACK_NAME} && {
echo " Stack ${PARSER_STACK_NAME} exist, delete it first."
- openstack stack delete --yes --wait ${PARSER_STACK_NAME}
+ openstack ${debug} stack delete --yes --wait ${PARSER_STACK_NAME}
}
+
# 2. Switch env to parser project temporally
echo " Switch openstack env to parser project"
change_env_to_parser_user_project