Signed-off-by: Hangbin Liu <liuhang...@gmail.com>
---
 testcases/lib/cmdlib.sh                        |  1 +
 testcases/lib/net_cmdlib.sh                    | 40 --------------------------
 testcases/lib/test_net.sh                      | 20 +++++++++++++
 testcases/network/tcp_cmds/arp/arp01           |  2 +-
 testcases/network/tcp_cmds/echo/echo01         |  2 +-
 testcases/network/tcp_cmds/finger/finger01     |  2 +-
 testcases/network/tcp_cmds/ftp/ftp01           |  2 +-
 testcases/network/tcp_cmds/host/host01         |  2 +-
 testcases/network/tcp_cmds/netstat/netstat01   |  2 +-
 testcases/network/tcp_cmds/perf_lan/perf_lan   |  2 +-
 testcases/network/tcp_cmds/ping/ping01         |  2 +-
 testcases/network/tcp_cmds/rcp/rcp01           |  2 +-
 testcases/network/tcp_cmds/rdist/rdist01       |  2 +-
 testcases/network/tcp_cmds/rsh/rsh01           |  2 +-
 testcases/network/tcp_cmds/rwho/rwho01         |  2 +-
 testcases/network/tcp_cmds/sendfile/sendfile01 |  2 +-
 testcases/network/tcp_cmds/tcpdump/tcpdump01   |  2 +-
 17 files changed, 35 insertions(+), 54 deletions(-)
 delete mode 100644 testcases/lib/net_cmdlib.sh

diff --git a/testcases/lib/cmdlib.sh b/testcases/lib/cmdlib.sh
index 104504f..fc0529e 100644
--- a/testcases/lib/cmdlib.sh
+++ b/testcases/lib/cmdlib.sh
@@ -24,6 +24,7 @@
 
 set -u
 
+export CMD_LIB_LOADED=1
 export SHELL_DEBUG=${SHELL_DEBUG:=0}
 if [ "x$SHELL_DEBUG" = x1 ] ; then
     set -x
diff --git a/testcases/lib/net_cmdlib.sh b/testcases/lib/net_cmdlib.sh
deleted file mode 100644
index d3488f9..0000000
--- a/testcases/lib/net_cmdlib.sh
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/sh
-#
-#    An extension to cmdlib.sh, purely for networking based commands.
-#
-#    Copyright (C) 2009, Cisco Systems Inc.
-#
-#    This program is free software; you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation; either version 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License along
-#    with this program; if not, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Garrett Cooper, August 2009
-#
-
-. cmdlib.sh
-
-# Blank for an IPV4 test; 6 for an IPV6 test.
-EXEC_SUFFIX=
-
-read_opts()
-{
-    while getopts "6" opt; do
-        case "$opt" in
-        6)
-            EXEC_SUFFIX=6;;
-        *)
-            echo "Setup  0  : FAIL Unknown option: $opt"
-            exit 1;;
-        esac
-    done
-}
diff --git a/testcases/lib/test_net.sh b/testcases/lib/test_net.sh
index 8cbcb70..17579b8 100644
--- a/testcases/lib/test_net.sh
+++ b/testcases/lib/test_net.sh
@@ -19,6 +19,26 @@
 #
 
 [ -z "$TST_LIB_LOADED" ] && . test.sh
+[ -z "$CMD_LIB_LOADED" ] && . cmdlib.sh
+
+# Blank for an IPV4 test; 6 for an IPV6 test.
+EXEC_SUFFIX=
+
+# Read script options
+# Options:
+# -6 run with IPv6
+read_opts()
+{
+    while getopts "6" opt; do
+        case "$opt" in
+        6)
+            EXEC_SUFFIX=6;;
+        *)
+            echo "Setup  0  : FAIL Unknown option: $opt"
+            exit 1;;
+        esac
+    done
+}
 
 # Run command on remote host.
 # Options:
diff --git a/testcases/network/tcp_cmds/arp/arp01 
b/testcases/network/tcp_cmds/arp/arp01
index 601b7eb..a05bc5e 100755
--- a/testcases/network/tcp_cmds/arp/arp01
+++ b/testcases/network/tcp_cmds/arp/arp01
@@ -104,7 +104,7 @@ do_test()
 # OUTPUT:   None.
 #-----------------------------------------------------------------------
 
-. net_cmdlib.sh
+. test_net.sh
 
 read_opts $*
 do_setup
diff --git a/testcases/network/tcp_cmds/echo/echo01 
b/testcases/network/tcp_cmds/echo/echo01
index 9260f21..335f5dd 100755
--- a/testcases/network/tcp_cmds/echo/echo01
+++ b/testcases/network/tcp_cmds/echo/echo01
@@ -121,7 +121,7 @@ do_test()
 #
 #-----------------------------------------------------------------------
 
-. net_cmdlib.sh
+. test_net.sh
 
 read_opts $*
 do_setup
diff --git a/testcases/network/tcp_cmds/finger/finger01 
b/testcases/network/tcp_cmds/finger/finger01
index e01c1ad..7ca9947 100755
--- a/testcases/network/tcp_cmds/finger/finger01
+++ b/testcases/network/tcp_cmds/finger/finger01
@@ -193,7 +193,7 @@ do_test3()
 # INPUT:    None.
 # OUTPUT:   None.
 #-----------------------------------------------------------------------
-. net_cmdlib.sh
+. test_net.sh
 
 read_opts $*
 do_setup
diff --git a/testcases/network/tcp_cmds/ftp/ftp01 
b/testcases/network/tcp_cmds/ftp/ftp01
index 8d23abc..1585be2 100755
--- a/testcases/network/tcp_cmds/ftp/ftp01
+++ b/testcases/network/tcp_cmds/ftp/ftp01
@@ -150,7 +150,7 @@ do_cleanup()
 # OUTPUT:   A testcase run log with the results of the execution of this
 #           test.
 #----------------------------------------------------------------------
-. net_cmdlib.sh
+. test_net.sh
 
 read_opts $*
 do_setup
diff --git a/testcases/network/tcp_cmds/host/host01 
b/testcases/network/tcp_cmds/host/host01
index fb59e35..68fe61b 100755
--- a/testcases/network/tcp_cmds/host/host01
+++ b/testcases/network/tcp_cmds/host/host01
@@ -79,7 +79,7 @@ do_test()
 #-----------------------------------------------------------------------
 # FUNCTION: MAIN
 #-----------------------------------------------------------------------
-. net_cmdlib.sh
+. test_net.sh
 
 read_opts $*
 do_setup
diff --git a/testcases/network/tcp_cmds/netstat/netstat01 
b/testcases/network/tcp_cmds/netstat/netstat01
index 3c2d1bb..49ab1f7 100755
--- a/testcases/network/tcp_cmds/netstat/netstat01
+++ b/testcases/network/tcp_cmds/netstat/netstat01
@@ -80,7 +80,7 @@ do_test() {
 # OUTPUT:    Logged run results written to testcase run log
 #
 #-----------------------------------------------------------------------
-. net_cmdlib.sh
+. test_net.sh
 
 read_opts $*
 do_setup
diff --git a/testcases/network/tcp_cmds/perf_lan/perf_lan 
b/testcases/network/tcp_cmds/perf_lan/perf_lan
index 595a091..67e4b3d 100755
--- a/testcases/network/tcp_cmds/perf_lan/perf_lan
+++ b/testcases/network/tcp_cmds/perf_lan/perf_lan
@@ -113,7 +113,7 @@ interrupt_testcase()
 # OUTPUT:    Logged run results written to testcase run log
 #
 #-----------------------------------------------------------------------
-. net_cmdlib.sh
+. test_net.sh
 
 read_opts $*
 
diff --git a/testcases/network/tcp_cmds/ping/ping01 
b/testcases/network/tcp_cmds/ping/ping01
index ce0dcfb..ac8ddaa 100755
--- a/testcases/network/tcp_cmds/ping/ping01
+++ b/testcases/network/tcp_cmds/ping/ping01
@@ -78,7 +78,7 @@ do_test()
 # FUNCTION:  MAIN
 #
 
#*******************************************************************************
-. net_cmdlib.sh
+. test_net.sh
 
 read_opts $*
 do_setup
diff --git a/testcases/network/tcp_cmds/rcp/rcp01 
b/testcases/network/tcp_cmds/rcp/rcp01
index 1f54471..905f728 100755
--- a/testcases/network/tcp_cmds/rcp/rcp01
+++ b/testcases/network/tcp_cmds/rcp/rcp01
@@ -136,7 +136,7 @@ do_cleanup()
 # OUTPUT:   A testcase run log with the results of the execution of this
 #           test.
 #----------------------------------------------------------------------
-. net_cmdlib.sh
+. test_net.sh
 
 read_opts $*
 do_setup
diff --git a/testcases/network/tcp_cmds/rdist/rdist01 
b/testcases/network/tcp_cmds/rdist/rdist01
index 4bc239f..4930426 100755
--- a/testcases/network/tcp_cmds/rdist/rdist01
+++ b/testcases/network/tcp_cmds/rdist/rdist01
@@ -179,7 +179,7 @@ do_test()
 # OUTPUT:   A testcase run log with the results of the execution of this
 #           test.
 #----------------------------------------------------------------------
-. net_cmdlib.sh
+. test_net.sh
 
 read_opts $*
 do_setup
diff --git a/testcases/network/tcp_cmds/rsh/rsh01 
b/testcases/network/tcp_cmds/rsh/rsh01
index 3968f90..2caaaf2 100755
--- a/testcases/network/tcp_cmds/rsh/rsh01
+++ b/testcases/network/tcp_cmds/rsh/rsh01
@@ -107,7 +107,7 @@ do_test()
 # OUTPUT:   A testcase run log with the results of the execution of this
 #           test.
 #----------------------------------------------------------------------
-. net_cmdlib.sh
+. test_net.sh
 
 read_opts $*
 do_setup
diff --git a/testcases/network/tcp_cmds/rwho/rwho01 
b/testcases/network/tcp_cmds/rwho/rwho01
index dc194e9..6f555c4 100755
--- a/testcases/network/tcp_cmds/rwho/rwho01
+++ b/testcases/network/tcp_cmds/rwho/rwho01
@@ -143,7 +143,7 @@ do_cleanup()
 # FUNCTION:  MAIN
 #
 #-----------------------------------------------------------------------
-. net_cmdlib.sh
+. test_net.sh
 
 read_opts $*
 do_setup
diff --git a/testcases/network/tcp_cmds/sendfile/sendfile01 
b/testcases/network/tcp_cmds/sendfile/sendfile01
index ad16290..39fc6cd 100755
--- a/testcases/network/tcp_cmds/sendfile/sendfile01
+++ b/testcases/network/tcp_cmds/sendfile/sendfile01
@@ -129,7 +129,7 @@ do_cleanup()
 #=============================================================================
 # MAIN PROCEDURE
 #=============================================================================
-. net_cmdlib.sh
+. test_net.sh
 
 read_opts $*
 do_setup
diff --git a/testcases/network/tcp_cmds/tcpdump/tcpdump01 
b/testcases/network/tcp_cmds/tcpdump/tcpdump01
index 6296ad2..70be8e5 100755
--- a/testcases/network/tcp_cmds/tcpdump/tcpdump01
+++ b/testcases/network/tcp_cmds/tcpdump/tcpdump01
@@ -82,7 +82,7 @@ do_test()
 # OUTPUT:    Logged run results written to testcase run log
 #
 #-----------------------------------------------------------------------
-. net_cmdlib.sh
+. test_net.sh
 
 read_opts $*
 do_setup
-- 
1.9.3


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to