Commit 2ac3a536 authored by Ophélie Gagnard's avatar Ophélie Gagnard Committed by Ophélie Gagnard

software/erp5testnode/testsuite/deploy-test: Allow arbitrary bash code.

Move hardcoded values to default values.
Source the whole content of the data-to-vm parameter.
parent ccfc6548
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
# not need these here). # not need these here).
[deploy-script-controller-script] [deploy-script-controller-script]
filename = deploy-script-controller filename = deploy-script-controller
md5sum = 6b2a293a38cf3ab69eba8d24fa1a8ea1 md5sum = 00bceb73d800806c100312ee027dcdcf
[template-deploy-test] [template-deploy-test]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = 1faa52013b12b1753bcaff0b1309ad90 md5sum = ba11521137356f4361b7d3d304f8fc0c
...@@ -38,15 +38,10 @@ if [ -z "$URL" ] ; then ...@@ -38,15 +38,10 @@ if [ -z "$URL" ] ; then
exit 1 exit 1
fi fi
if [ -z "$WAITTIME" ] ; then export WAITTIME=${WAITTIME:-360}
echo "WAITTIME missing" >> $LOG_FILE 2>&1 echo "INFO: WAITTIME is $WAITTIME" >> "$LOG_FILE" 2>&1
exit 1 export TRIES=${TRIES:-80}
fi echo "INFO: TRIES is $TRIES" >> "$LOG_FILE" 2>&1
if [ -z "$TRIES" ] ; then
echo "TRIES missing" >> $LOG_FILE 2>&1
exit 1
fi
DEPLOYMENT_SCRIPT=/tmp/test-script-deployment.bash."$$" DEPLOYMENT_SCRIPT=/tmp/test-script-deployment.bash."$$"
wget -O "$DEPLOYMENT_SCRIPT" -q "$URL" wget -O "$DEPLOYMENT_SCRIPT" -q "$URL"
...@@ -89,7 +84,6 @@ function upload () ...@@ -89,7 +84,6 @@ function upload ()
try=1 try=1
while true; do while true; do
echo "$0: Try $try. Running '/bin/bash $DEPLOYMENT_SCRIPT'" >> "$LOG_FILE" 2>&1 echo "$0: Try $try. Running '/bin/bash $DEPLOYMENT_SCRIPT'" >> "$LOG_FILE" 2>&1
export TEST_YML_PATH
/bin/bash "$DEPLOYMENT_SCRIPT" >> "$LOG_FILE" 2>&1 /bin/bash "$DEPLOYMENT_SCRIPT" >> "$LOG_FILE" 2>&1
result="$?" result="$?"
if [ "$result" == 0 ] ; then if [ "$result" == 0 ] ; then
......
...@@ -2,8 +2,7 @@ ...@@ -2,8 +2,7 @@
{% set test_type = slapparameter_dict.get('test-type', 'script-from-url') -%} {% set test_type = slapparameter_dict.get('test-type', 'script-from-url') -%}
{# Choose parameters according to test type -#} {# Choose parameters according to test type -#}
{% if test_type == 'script-from-url' -%} {% if test_type == 'script-from-url' -%}
{% set script_url = slapparameter_dict.get('script-to-test-url') -%} {% set data_to_vm = slapparameter_dict.get('data-to-vm') -%}
{% set test_yml_path = '/not/required' -%}
{% elif test_type == 'cloned-playbook' -%} {% elif test_type == 'cloned-playbook' -%}
{% set script_url = 'http://10.0.2.100/standalone-local-playbook' -%} {% set script_url = 'http://10.0.2.100/standalone-local-playbook' -%}
{% set test_yml_path = slapparameter_dict.get('yml-path-to-test') -%} {% set test_yml_path = slapparameter_dict.get('yml-path-to-test') -%}
...@@ -38,10 +37,7 @@ config-bootstrap-script-url = {{ in_vm_test_script }}#{{ in_vm_test_script_md5 } ...@@ -38,10 +37,7 @@ config-bootstrap-script-url = {{ in_vm_test_script }}#{{ in_vm_test_script_md5 }
# Script configuration # Script configuration
config-data-to-vm = config-data-to-vm =
URL={{ script_url }} {{ data_to_vm }}
WAITTIME={{ waittime }}
TRIES={{ tries }}
TEST_YML_PATH={{ test_yml_path }}
# require HTTP server # require HTTP server
config-enable-http-server = true config-enable-http-server = true
......
...@@ -48,8 +48,6 @@ context = ...@@ -48,8 +48,6 @@ context =
raw bin_directory ${buildout:bin-directory} raw bin_directory ${buildout:bin-directory}
raw in_vm_test_script ${deploy-script-controller-script:location} raw in_vm_test_script ${deploy-script-controller-script:location}
raw in_vm_test_script_md5 ${deploy-script-controller-script:md5sum} raw in_vm_test_script_md5 ${deploy-script-controller-script:md5sum}
raw waittime ${deploy-script-controller-script:waittime}
raw tries ${deploy-script-controller-script:tries}
section test_image_repository test-image-repository section test_image_repository test-image-repository
[test-image-repository] [test-image-repository]
......
...@@ -43,9 +43,6 @@ output = ${buildout:directory}/template-original.kvm.cfg ...@@ -43,9 +43,6 @@ output = ${buildout:directory}/template-original.kvm.cfg
[deploy-script-controller-script] [deploy-script-controller-script]
location = ${:_profile_base_location_}/${:filename} location = ${:_profile_base_location_}/${:filename}
# configuration
waittime = 360
tries = 80
[standalone-local-playbook] [standalone-local-playbook]
filename = standalone-local-playbook filename = standalone-local-playbook
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment