Enhancing stw and stcs to allow pausing between scenarios
Change-Id: Ie5c9e41e0d0861a7d419fa5532674bf8bb206eb4
diff --git a/tools/dev/bash_profile b/tools/dev/bash_profile
index a288765..1d987fd 100644
--- a/tools/dev/bash_profile
+++ b/tools/dev/bash_profile
@@ -107,7 +107,15 @@
# Runs a sequence of STC scenarios until the first failure.
function stcs {
- for s in "$@"; do stc $s || return 1; done
+ for s in "$@"; do
+ if [[ $s =~ ^[0-9]*$ ]]; then
+ printf "Waiting %d seconds...\n" $s
+ sleep $s
+ else
+ printf "Running scenario %s...\n" $s
+ stc $s || return 1
+ fi
+ done
}
# Applies the settings in the specified topology recipe file or lists current
diff --git a/tools/test/bin/stw b/tools/test/bin/stw
index 8231ee7..677d29c 100755
--- a/tools/test/bin/stw
+++ b/tools/test/bin/stw
@@ -33,8 +33,13 @@
# Iterate over all listed scenarios
for scenario in "${@:-smoke}"; do
- printf "Running scenario %s...\n" $scenario
- stc $scenario
+ if [[ $scenario =~ ^[0-9]*$ ]]; then
+ printf "Waiting %d seconds...\n" $scenario
+ sleep $scenario
+ else
+ printf "Running scenario %s...\n" $scenario
+ stc $scenario
+ fi
done
status=$?