Skip to contentSkip to conversation

cmdlib: Update exists function to exit with TCONF

PATCH New Kory Maincent 2 participants 2 messages Mar 3, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cmdlib: Update exists function to exit with TCONF

The exists function which tests the existence of a command was returning an error.
Update it to return TCONF and exit with the value 32.

---

This function is only used by ftp01.sh test.
The real effort should be to rewrite ftp01 test to the new API, but I did not manage to do it properly and makes it compatible with the other ftp clients.

 testcases/lib/cmdlib.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
testcases/lib/cmdlib.sh +2 -2
index e4986c39c..ad93e3cc8 100644
@@ -103,8 +103,8 @@ exists()
 {
     for cmd in $*; do
         if ! command -v $cmd >/dev/null 2>&1; then
-            end_testcase "$cmd: command not found"
-            exit 1
+            tst_brkm TCONF NULL "$1: command $2 not found."
+            exit 32
         fi
     done
 }
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 cmdlib: Update exists function to exit with TCONF

Hi!

testcases/lib/cmdlib.sh exists() · line 107

Quoted 2 lines
testcases/lib/cmdlib.sh +2 -0
+            tst_brkm TCONF NULL "$1: command $2 not found."
+            exit 32

I've changed this to tst_resm, since it does not make any sense to use the tst_brkm from apicmds and it only makes the code more confusing with parameters that are not used at all.

And pushed, thanks.

Signature · 2 lines
Cyril Hrubis
[email protected]