diff options
author | shangxdy <shang.xiaodong@zte.com.cn> | 2018-02-02 01:55:39 +0800 |
---|---|---|
committer | shangxdy <shang.xiaodong@zte.com.cn> | 2018-02-02 02:04:23 +0800 |
commit | d6c75bcf6eb3dd88a2dee1478236dcf09b73daf9 (patch) | |
tree | 11ffe63d0ef820dcc98cc368fb7118324a297e91 /tests/functest_run.sh | |
parent | d34e39b641ab1ef5436ace62a814a5d8b027853b (diff) |
Add default flavor
Add default falvor since there is not any flavor for
some installers.
JIRA: PARSER-172
Change-Id: I5fb0fdc4857a35840399c8cec8f051055a3a4eac
Signed-off-by: shangxdy <shang.xiaodong@zte.com.cn>
Diffstat (limited to 'tests/functest_run.sh')
-rwxr-xr-x | tests/functest_run.sh | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/tests/functest_run.sh b/tests/functest_run.sh index bdbe898..c85219e 100755 --- a/tests/functest_run.sh +++ b/tests/functest_run.sh @@ -47,6 +47,11 @@ PARSER_TENANT=${PARSER_PROJECT} PARSER_ROLE=admin +VM_FLAVOR_NAME=m1.tiny +VM_FLAVOR_CPUS=1 +VM_FLAVOR_RAM=512 +VM_FLAVOR_DISK=1 + PARSER_STACK_NAME=vRNC_Stack # VRNC_INPUT_TEMPLATE_FILE=${PRASER_WORK_DIR}/../tosca2heat/tosca-parser/toscaparser/extensions/nfv/tests/data/vRNC/Definitions/vRNC.yaml @@ -68,7 +73,7 @@ download_parser_image() { wget ${PARSER_IMAGE_URL} -o ${PARSER_IMAGE_FILE} } -register_parser_image() { +register_parser_image_and_flavor() { openstack ${debug} image list | grep -qwo "${PARSER_IMAGE_NAME}" && { echo " Image ${PARSER_IMAGE_NAME} has bee registed, needn't registe again." return 0 @@ -81,6 +86,12 @@ register_parser_image() { --disk-format ${PARSER_IMAGE_FORMAT} \ --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() { @@ -313,9 +324,9 @@ trap reset_parser_test EXIT # start syslog for loghander which service > /dev/null && service rsyslog restart || true -echo "|========= 1/4. Preparing VM image for parser... =========|" +echo "|========= 1/4. Preparing VM image and flavor for parser... =========|" download_parser_image -register_parser_image +register_parser_image_and_flavor echo "" echo "|========= 2/4. Creating test user for parser... =========|" |