[ducktests] Run extra setup script on all docker nodes
@@ -232,6 +232,14 @@ ask_yes_no() {
done
}
+# Wait for all the background jobs
+wait_jobs() {
+ for job in `jobs -p`
+ do
+ wait $job
+ done
+}
+
# Build a docker image.
#
# $1: The docker build context
@@ -487,7 +495,11 @@ ducker_test() {
must_popd
if [[ -n "${DUCKTAPE_EXTRA_SETUP}" ]]; then
echo "executing extra ducktape setup with '${DUCKTAPE_EXTRA_SETUP}'"
- docker exec --user=root ducker01 bash -c "${DUCKTAPE_EXTRA_SETUP}"
+ local nodes=$(echo_running_container_names)
+ for node in ${nodes}; do
+ docker exec --user=root ${node} bash -c "${DUCKTAPE_EXTRA_SETUP}" &
+ done
+ wait_jobs
[[ $? -ne 0 ]] && die "failed to execute extra ducktape setup."
fi
cmd="cd /opt/ignite-dev && ducktape --cluster-file /opt/ignite-dev/modules/ducktests/tests/docker/build/cluster.json $args"
