aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2022-05-12 16:33:57 +1000
committerStefano Brivio <sbrivio@redhat.com>2022-05-19 15:24:15 +0200
commit4643b9b74c844cced27b3d04d3fcb69d51de8d28 (patch)
tree52ed14d173fdbfbea950dad74df5495e58523b4c
parent13ad716f300b2e78866978a1e4097e5ad016cbc1 (diff)
downloadpasst-4643b9b74c844cced27b3d04d3fcb69d51de8d28.tar
passt-4643b9b74c844cced27b3d04d3fcb69d51de8d28.tar.gz
passt-4643b9b74c844cced27b3d04d3fcb69d51de8d28.tar.bz2
passt-4643b9b74c844cced27b3d04d3fcb69d51de8d28.tar.lz
passt-4643b9b74c844cced27b3d04d3fcb69d51de8d28.tar.xz
passt-4643b9b74c844cced27b3d04d3fcb69d51de8d28.tar.zst
passt-4643b9b74c844cced27b3d04d3fcb69d51de8d28.zip
tests: Simplify *tools commands using pane_status
Now that we have pane_status to check the success of commands issued to panes, we can more easily check for the success of the 'which' commands used to check tool availability, rather than constructing, then parsing special "skip" output. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-rwxr-xr-xtest/lib/test25
1 files changed, 10 insertions, 15 deletions
diff --git a/test/lib/test b/test/lib/test
index 4262343..a5583e3 100755
--- a/test/lib/test
+++ b/test/lib/test
@@ -151,9 +151,8 @@ test_one_line() {
tmux send-keys -t ${PANE_HOST} "C-c"
;;
"htools")
- pane_run HOST 'which '"${__arg}"' >/dev/null || echo skip'
- pane_wait HOST
- [ "$(pane_parse HOST)" = "skip" ] && TEST_ONE_skip=1 || true
+ pane_run HOST 'which '"${__arg}"' >/dev/null'
+ pane_status HOST || TEST_ONE_skip=1
;;
"passt")
pane_run PASST "${__arg}"
@@ -192,19 +191,16 @@ test_one_line() {
pane_status GUEST_1 || TEST_ONE_nok=1
;;
"gtools")
- pane_run GUEST 'which '"${__arg}"' >/dev/null || echo skip'
- pane_wait GUEST
- [ "$(pane_parse GUEST)" = "skip" ] && TEST_ONE_skip=1 || true
+ pane_run GUEST 'which '"${__arg}"' >/dev/null'
+ pane_status GUEST || TEST_ONE_skip=1
;;
"g1tools")
- pane_run GUEST_1 'which '"${__arg}"' >/dev/null || echo skip'
- pane_wait GUEST_1
- [ "$(pane_parse GUEST_1)" = "skip" ] && TEST_ONE_skip=1 || true
+ pane_run GUEST_1 'which '"${__arg}"' >/dev/null'
+ pane_status GUEST_1 || TEST_ONE_skip=1
;;
"g2tools")
- pane_run GUEST_2 'which '"${__arg}"' >/dev/null || echo skip'
- pane_wait GUEST_2
- [ "$(pane_parse GUEST_2)" = "skip" ] && TEST_ONE_skip=1 || true
+ pane_run GUEST_2 'which '"${__arg}"' >/dev/null'
+ pane_status GUEST_2 || TEST_ONE_skip=1
;;
"guest2")
pane_run GUEST_2 "${__arg}"
@@ -247,9 +243,8 @@ test_one_line() {
pane_status NS2 || TEST_ONE_nok=1
;;
"nstools")
- pane_run NS 'which '"${__arg}"' >/dev/null || echo skip'
- pane_wait NS
- [ "$(pane_parse NS)" = "skip" ] && TEST_ONE_skip=1 || true
+ pane_run NS 'which '"${__arg}"' >/dev/null'
+ pane_status NS || TEST_ONE_skip=1
;;
"gout")
__varname="${__arg%% *}"