'ip' tools is more general than 'ifconfig', and there are some
distros don't support to install 'ifconfig' tools under default,
which will cause such below error:

   sh: ifconfig: command not found
   sendmsg01    1  TBROK  :  ifconfig failed to bring up loop back device
   sendmsg01    2  TBROK  :  Remaining cases broken

the patch displaced 'ifconfig' using 'ip', and also the case need root
permission and checking capture unexpected signal.

Signed-off-by: Zhouping Liu <[email protected]>
---
 testcases/kernel/syscalls/sendmsg/sendmsg01.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/testcases/kernel/syscalls/sendmsg/sendmsg01.c 
b/testcases/kernel/syscalls/sendmsg/sendmsg01.c
index e1424ca..2376e3e 100644
--- a/testcases/kernel/syscalls/sendmsg/sendmsg01.c
+++ b/testcases/kernel/syscalls/sendmsg/sendmsg01.c
@@ -573,6 +573,9 @@ static void setup(void)
 {
 
        int ret = 0;
+
+       tst_require_root(NULL);
+       tst_sig(FORK, DEF_HANDLER, cleanup);
        TEST_PAUSE;
 
        /* initialize sockaddr's */
@@ -586,12 +589,12 @@ static void setup(void)
        strcpy(sun1.sun_path, tmpsunpath);
 
        /* this test will fail or in some cases hang if no eth or lo is
-        * configured, so making sure in setup that atleast lo is up
+        * configured, so making sure in setup that at least lo is up
         */
-       ret = system("ifconfig lo up 127.0.0.1");
+       ret = system("ip link set lo up");
        if (WEXITSTATUS(ret) != 0) {
                tst_brkm(TBROK, cleanup,
-                        "ifconfig failed to bring up loop back device");
+                        "ip failed to bring up loop back device");
                tst_exit();
        }
 
@@ -607,7 +610,6 @@ static void cleanup(void)
        unlink(tmpsunpath);
        TEST_CLEANUP;
        tst_rmdir();
-
 }
 
 static void setup0(void)
-- 
1.7.11.7


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to