aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThomas Duval <thomas.duval@orange.com>2018-01-22 15:51:03 +0100
committerThomas Duval <thomas.duval@orange.com>2018-01-24 09:55:31 +0100
commit72413a4640e458690cf65f445bc10f28886f4e8f (patch)
treeb7e4ac1c181584f07e28b39e6aa24d3cf00822f5 /tests
parent36fe604a69eaa4c36f309bd68e36d75c3850c5c4 (diff)
Functional tests development
Change-Id: I641522d813f171a4eed0e6b39b2f25cc470c76d1
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/run_tests.sh10
-rw-r--r--tests/functional/run_tests_for_component.sh27
2 files changed, 37 insertions, 0 deletions
diff --git a/tests/functional/run_tests.sh b/tests/functional/run_tests.sh
index ced0f9f7..c5cbabbb 100644
--- a/tests/functional/run_tests.sh
+++ b/tests/functional/run_tests.sh
@@ -1,3 +1,13 @@
#!/usr/bin/env bash
echo "starting Moon Functional Tests"
+
+COMPONENTS="moon_authz, moon_interface, moon_manager, moon_orchestrator, moon_wrapper"
+
+for dir in ${COMPONENTS}; do
+ echo "Testing component ${dir}"
+ cd ${MOON_HOME}/${dir}
+ docker run --rm --volume $(pwd):/data wukongsun/moon_forming:latest /bin/bash /root/switch.sh functest
+done
+
+# TODO: download tests results
diff --git a/tests/functional/run_tests_for_component.sh b/tests/functional/run_tests_for_component.sh
new file mode 100644
index 00000000..fd9ab7fa
--- /dev/null
+++ b/tests/functional/run_tests_for_component.sh
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+
+CUR_PWD=$(pwd)
+INPUT_FILE=../tools/moon_kubernetes/templates/moon_forming_functest.yaml
+OUTPUT_FILE=tests/functional_pod/moon_forming_functest.yaml
+
+echo current working directory: ${CUR_PWD}
+
+cat ${INPUT_FILE} | sed "s|{{PATH}}|${CUR_PWD}|" > ${OUTPUT_FILE}
+
+kubectl create -f ${OUTPUT_FILE}
+
+sleep 5
+kubectl get -n moon jobs
+echo OUTPUT is $?
+if [ "$?" -ne 0 ]
+then
+ sleep 5
+ kubectl get -n moon jobs
+fi
+
+echo "waiting for FuncTests (it may takes time)..."
+echo -e "\033[35m"
+sed '/<END OF JOB>/q' <(kubectl logs -n moon jobs/functest -f)
+echo -e "\033[m"
+
+kubectl delete -f ${OUTPUT_FILE}