aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeah Rumancik <leah.rumancik@gmail.com>2023-01-18 14:02:03 -0800
committerLeah Rumancik <leah.rumancik@gmail.com>2023-02-14 13:13:47 -0800
commitecac1c9309db1c3ecf69716c6325dd157f339a14 (patch)
tree3a88a932209f96d0d089d54e00884af4bb1bbac3
parentf39498900ff130d1e622090f3e52792e785b24b7 (diff)
downloadxfstests-bld-ecac1c9309db1c3ecf69716c6325dd157f339a14.tar.gz
gce-xfstests: allow foreground execution of rm <vm>
Add --wait flag to prevent running command in background. This is useful for selftests that want to wait for LTM to shutdown. Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
-rwxr-xr-xrun-fstests/gce-xfstests12
1 files changed, 10 insertions, 2 deletions
diff --git a/run-fstests/gce-xfstests b/run-fstests/gce-xfstests
index 589de88f..4373813a 100755
--- a/run-fstests/gce-xfstests
+++ b/run-fstests/gce-xfstests
@@ -233,6 +233,14 @@ case "$1" in
deldisks="--delete-disks all"
fi
shift
+
+ bg="&"
+ if test "$1" = "--wait"
+ then
+ bg=
+ shift
+ fi
+
for i in "$@"
do
if test -n "$deldisks"
@@ -245,8 +253,8 @@ case "$1" in
run_gcloud compute -q instances add-metadata "$i" \
--metadata "shutdown_reason=$reason" \
--zone "$zone" > /dev/null
- run_gcloud compute -q instances delete "$i" \
- --zone "$zone" $deldisks &
+ eval run_gcloud compute -q instances delete "$i" \
+ --zone "$zone" $deldisks $bg
done
exit 0
;;