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>
This commit is contained in:
parent
21b1a8445b
commit
8ca491e7c0
1 changed files with 9 additions and 6 deletions
|
@ -193,13 +193,16 @@ pane_run() {
|
||||||
# pane_wait() - Wait for command to be done in given pane name
|
# pane_wait() - Wait for command to be done in given pane name
|
||||||
# $1: Pane name
|
# $1: Pane name
|
||||||
pane_wait() {
|
pane_wait() {
|
||||||
__pane_lc="$(echo "${1}" | tr [A-Z] [a-z])"
|
__lc="$(echo "${1}" | tr [A-Z] [a-z])"
|
||||||
|
|
||||||
while [ "$(tail -n1 ${LOGDIR}/pane_${__pane_lc}.log)" != '$ ' ] && \
|
__done=0
|
||||||
[ "$(tail -n1 ${LOGDIR}/pane_${__pane_lc}.log)" != '# ' ] && \
|
while
|
||||||
[ "$(tail -n1 ${LOGDIR}/pane_${__pane_lc}.log)" != '# # ' ]; do
|
__l="$(tail -1 ${LOGDIR}/pane_${__lc}.log | tr -d [:cntrl:])"
|
||||||
sleep 0.1 || sleep 1
|
case ${__l} in
|
||||||
done
|
'$ ' | '# ' | '# # ' | *"$ " | *"# ") return ;;
|
||||||
|
*" #[m " | *" #[m [K" | *"]# ["*) return ;;
|
||||||
|
esac
|
||||||
|
do sleep 0.1 || sleep 1; done
|
||||||
}
|
}
|
||||||
|
|
||||||
# pane_parse() - Print last line, @EMPTY@ if command had no output
|
# pane_parse() - Print last line, @EMPTY@ if command had no output
|
||||||
|
|
Loading…
Reference in a new issue