Skip to contentSkip to conversation

network/xinetd: source test_net.sh for tst_retry

PATCH New Hangbin Liu 1 participant 3 messages Apr 29, 2016 – May 20, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 network/xinetd: source test_net.sh for tst_retry

Fix error: xinetd_tests.sh: line 323: tst_retry: command not found. tst_retry was defined in test.sh. Since this is a network test, source test_net.sh directly.

---
 testcases/network/xinetd/xinetd_tests.sh | 1 +
 1 file changed, 1 insertion(+)
testcases/network/xinetd/xinetd_tests.sh +1 -0
index e50a511..58fb98e 100755
@@ -63,6 +63,7 @@ init()
     export TST_TOTAL=2
     export TCID="xinetd"
     export TST_COUNT=0
+    . test_net.sh
     . daemonlib.sh
 
     if [ -f "/usr/lib/systemd/system/telnet.socket" ]; then
Signature · 1 line
2.5.5
#2 lore raw

PATCH 2/2 network/xinetd: tst_xinetd.exp.2 want get both standard and error output

tst_xinetd.exp.2 want get both standard and error output, like Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Connection closed by foreign host.

We will get nothing if use like 2>log 2>&1, fix this by use &>log.

Also fix a tst_retry typo.

---
 testcases/network/xinetd/xinetd_tests.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
testcases/network/xinetd/xinetd_tests.sh +2 -2
index 58fb98e..0bf3bec 100755
@@ -388,7 +388,7 @@ test01()
     # not terminated by the test gracefully.
     if [ $IPV6_ENABLED -eq 1 ]
     then
-        tst_retry "echo '' | $TELNET_COMM ::1 2>$LTPTMP/tst_xinetd.out.ipv6 2>&1"
+        tst_retry "echo '' | $TELNET_COMM ::1 &> $LTPTMP/tst_xinetd.out.ipv6"
         diff -iwB $LTPTMP/tst_xinetd.out.ipv6  $LTPTMP/tst_xinetd.exp.2.ipv6 \
             > $LTPTMP/tst_xinetd.err.ipv6 2>&1
         RC=$?
@@ -403,7 +403,7 @@ test01()
         fi
     fi
 
-    test_retry "echo '' | $TELNET_COMM 127.0.0.1 2>$LTPTMP/tst_xinetd.out 2>&1"
+    tst_retry "echo '' | $TELNET_COMM 127.0.0.1 &> $LTPTMP/tst_xinetd.out"
 
     diff -iwB $LTPTMP/tst_xinetd.out  $LTPTMP/tst_xinetd.exp.2 \
         > $LTPTMP/tst_xinetd.err 2>&1
Signature · 1 line
2.5.5
#1 lore raw

PATCH 1/2 network/xinetd: source test_net.sh for tst_retry

In reply to Hangbin Liu

Hi Alexey,

Would you like to help review this patch set?

Thanks
Hangbin

Quoted 27 lines · Hangbin Liu

Fix error: xinetd_tests.sh: line 323: tst_retry: command not found. tst_retry was defined in test.sh. Since this is a network test, source test_net.sh directly.

---
 testcases/network/xinetd/xinetd_tests.sh | 1 +
 1 file changed, 1 insertion(+)
testcases/network/xinetd/xinetd_tests.sh +1 -0
index e50a511..58fb98e 100755
@@ -63,6 +63,7 @@ init()
     export TST_TOTAL=2
     export TCID="xinetd"
     export TST_COUNT=0
+    . test_net.sh
     . daemonlib.sh
 
     if [ -f "/usr/lib/systemd/system/telnet.socket" ]; then
Signature · 5 lines
2.5.5


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