From: Zhouping L. <zl...@re...> - 2013-01-21 15:55:22
|
'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 <zl...@re...> --- 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 |