public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Wei Gao via ltp <ltp@lists.linux.it>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2] ftp01.sh: Add support for test lftp
Date: Tue, 24 Sep 2024 23:57:56 -0400	[thread overview]
Message-ID: <20240925035756.14873-1-wegao@suse.com> (raw)
In-Reply-To: <20240918100344.21316-1-wegao@suse.com>

Signed-off-by: Wei Gao <wegao@suse.com>
---
 testcases/network/tcp_cmds/ftp/ftp01.sh | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/testcases/network/tcp_cmds/ftp/ftp01.sh b/testcases/network/tcp_cmds/ftp/ftp01.sh
index 53d1eec53..12d32a9a9 100755
--- a/testcases/network/tcp_cmds/ftp/ftp01.sh
+++ b/testcases/network/tcp_cmds/ftp/ftp01.sh
@@ -4,6 +4,7 @@
 # Copyright (c) 2003 Manoj Iyer <manjo@mail.utexas.edu>
 # Copyright (c) 2001 Robbie Williamson <robbiew@us.ibm.com>
 
+TST_SETUP=setup
 TST_TESTFUNC=do_test
 TST_CNT=4
 TST_NEEDS_CMDS='awk ftp'
@@ -11,6 +12,16 @@ TST_NEEDS_TMPDIR=1
 
 RUSER="${RUSER:-root}"
 RHOST="${RHOST:-localhost}"
+FTP_CMD="ftp -nv"
+
+setup()
+{
+    if tst_cmd_available lftp; then
+        FTP_CMD="lftp --norc"
+    else
+        tst_brkm TCONF "No FTP client found"
+    fi
+}
 
 do_test()
 {
@@ -41,7 +52,7 @@ test_get()
             echo cd $TST_NET_DATAROOT
             echo get $file
             echo quit
-        } | ftp -nv $RHOST
+        } | $FTP_CMD $RHOST
 
         sum1="$(ls -l $file | awk '{print $5}')"
         sum2="$(ls -l $TST_NET_DATAROOT/$file | awk '{print $5}')"
@@ -62,7 +73,7 @@ test_put()
             echo cd $TST_TMPDIR
             echo put $file
             echo quit
-        } | ftp -nv $RHOST
+        } | $FTP_CMD $RHOST
 
         sum1="$(tst_rhost_run -c "sum $TST_TMPDIR/$file" -s | awk '{print $1}')"
         sum2="$(sum $TST_NET_DATAROOT/$file | awk '{print $1}')"
-- 
2.35.3


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  parent reply	other threads:[~2024-09-25  3:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-18 10:03 [LTP] [PATCH v1] tst_test.sh: Add support for localhost ssh key setup Wei Gao via ltp
2024-09-18 11:46 ` Martin Doucha
2024-09-24 10:15   ` Wei Gao via ltp
2024-09-24 12:08     ` Martin Doucha
2024-09-25  3:57 ` Wei Gao via ltp [this message]
2024-10-15 19:39   ` [LTP] [PATCH v2] ftp01.sh: Add support for test lftp Petr Vorel
2024-10-16  3:13     ` Wei Gao via ltp
2024-10-16 13:41       ` Petr Vorel
2024-11-04 16:20       ` Petr Vorel
2024-10-16 12:47     ` Cyril Hrubis
2024-10-16 13:48       ` Petr Vorel
2024-10-16 15:32         ` Cyril Hrubis
2024-10-16 16:17       ` Martin Doucha
2024-10-16 21:15         ` Petr Vorel
2024-11-01 12:11           ` Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240925035756.14873-1-wegao@suse.com \
    --to=ltp@lists.linux.it \
    --cc=wegao@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox