From: Juha Kosonen Date: Wed, 8 Jan 2020 12:51:51 +0000 (+0200) Subject: Run Docker Bench parallel on all nodes X-Git-Tag: 3.0.0~17 X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=5e50693445cfb15af3416a0fd8cec26eb8428f0c;p=validation.git Run Docker Bench parallel on all nodes Execute Docker Bench against all target node parallel instead of testing them one by one. This way the total execution time does not depend on the number of nodes to be tested. Change-Id: I9a8005f76ebe86c659ec82debe26a55940917028 Signed-off-by: Juha Kosonen --- diff --git a/tests/docker/docker_bench/docker_bench.resource b/tests/docker/docker_bench/docker_bench.resource index 674087f..8a93e3d 100644 --- a/tests/docker/docker_bench/docker_bench.resource +++ b/tests/docker/docker_bench/docker_bench.resource @@ -18,6 +18,7 @@ *** Settings *** Library BuiltIn +Library Collections Library OperatingSystem Library Process Library SSHLibrary @@ -43,12 +44,18 @@ Upload Test Software To Nodes Copy Test Software To All Nodes Run Test Software On Nodes - :FOR ${node} IN @{nodes} - \ Execute Command ssh ${SSH_OPTS} ${node} "cd ${NODEDIR}; sudo ./docker-bench-security.sh -b -l bench.log" - \ Execute Command scp ${SSH_OPTS} ${node}:${NODEDIR}/bench.log ${DESTDIR}/docker-bench-${node}.log - \ Execute Command scp ${SSH_OPTS} ${node}:${NODEDIR}/bench.log.json ${DESTDIR}/docker-bench-${node}.json - \ SSHLibrary.Get File ${DESTDIR}/docker-bench-${node}.log ${REPORTDIR}/ - \ SSHLibrary.Get File ${DESTDIR}/docker-bench-${node}.json ${REPORTDIR}/ + FOR ${node} IN @{nodes} + Start Command ssh ${SSH_OPTS} ${node} "cd ${NODEDIR}; sudo ./docker-bench-security.sh -b -l bench.log" + END + @{tmp}= Copy List ${nodes} + Reverse List ${tmp} + FOR ${node} IN @{tmp} + Read Command Output return_stdout=False + Execute Command scp ${SSH_OPTS} ${node}:${NODEDIR}/bench.log ${DESTDIR}/docker-bench-${node}.log + Execute Command scp ${SSH_OPTS} ${node}:${NODEDIR}/bench.log.json ${DESTDIR}/docker-bench-${node}.json + SSHLibrary.Get File ${DESTDIR}/docker-bench-${node}.log ${REPORTDIR}/ + SSHLibrary.Get File ${DESTDIR}/docker-bench-${node}.json ${REPORTDIR}/ + END Get Node Addresses ${stdout}= Execute Command @@ -57,11 +64,13 @@ Get Node Addresses Set Test Variable @{nodes} Copy Test Software To All Nodes - :FOR ${node} IN @{nodes} - \ Execute Command ssh ${SSH_OPTS} ${node} "mkdir -p ${NODEDIR}" - \ Execute Command scp ${SSH_OPTS} -rp ${DESTDIR}/. ${node}:${NODEDIR} + FOR ${node} IN @{nodes} + Execute Command ssh ${SSH_OPTS} ${node} "mkdir -p ${NODEDIR}" + Execute Command scp ${SSH_OPTS} -rp ${DESTDIR}/. ${node}:${NODEDIR} + END Remove Test Software From Nodes - :FOR ${node} IN @{nodes} - \ Execute Command ssh ${SSH_OPTS} ${node} "rm -rf ${NODEDIR}" + FOR ${node} IN @{nodes} + Execute Command ssh ${SSH_OPTS} ${node} "rm -rf ${NODEDIR}" + END Execute Command rm -rf ${DESTDIR}