aboutgitcodebugslistschat
path: root/test/lib
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2022-01-26 07:40:35 +0100
committerStefano Brivio <sbrivio@redhat.com>2022-01-28 02:05:19 +0100
commit8ca491e7c0842023404d35af7472cba64458b1fc (patch)
treea51048473a5e07df029e9db70d8ff25ea2b7a664 /test/lib
parent21b1a8445b12bcc72b10c1e08185eb8a0e3fa731 (diff)
downloadpasst-8ca491e7c0842023404d35af7472cba64458b1fc.tar
passt-8ca491e7c0842023404d35af7472cba64458b1fc.tar.gz
passt-8ca491e7c0842023404d35af7472cba64458b1fc.tar.bz2
passt-8ca491e7c0842023404d35af7472cba64458b1fc.tar.lz
passt-8ca491e7c0842023404d35af7472cba64458b1fc.tar.xz
passt-8ca491e7c0842023404d35af7472cba64458b1fc.tar.zst
passt-8ca491e7c0842023404d35af7472cba64458b1fc.zip
test/lib/term: Allow for a wider variety of prompt characters in pane_wait()
We might have highlighting and slightly different prompts across different distributions, allow a more reasonable set of prompt strings to be accepted as prompts. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'test/lib')
-rwxr-xr-xtest/lib/term17
1 files changed, 10 insertions, 7 deletions
diff --git a/test/lib/term b/test/lib/term
index 78e2bd3..cc6349f 100755
--- a/test/lib/term
+++ b/test/lib/term
@@ -193,13 +193,16 @@ pane_run() {
# pane_wait() - Wait for command to be done in given pane name
# $1: Pane name
pane_wait() {
- __pane_lc="$(echo "${1}" | tr [A-Z] [a-z])"
-
- while [ "$(tail -n1 ${LOGDIR}/pane_${__pane_lc}.log)" != '$ ' ] && \
- [ "$(tail -n1 ${LOGDIR}/pane_${__pane_lc}.log)" != '# ' ] && \
- [ "$(tail -n1 ${LOGDIR}/pane_${__pane_lc}.log)" != '# # ' ]; do
- sleep 0.1 || sleep 1
- done
+ __lc="$(echo "${1}" | tr [A-Z] [a-z])"
+
+ __done=0
+ while
+ __l="$(tail -1 ${LOGDIR}/pane_${__lc}.log | tr -d [:cntrl:])"
+ case ${__l} in
+ '$ ' | '# ' | '# # ' | *"$ " | *"# ") return ;;
+ *" #[m " | *" #[m [K" | *"]# ["*) return ;;
+ esac
+ do sleep 0.1 || sleep 1; done
}
# pane_parse() - Print last line, @EMPTY@ if command had no output