linux-test-project / ltp

Linux Test Project (mailing list: https://lists.linux.it/listinfo/ltp)
https://linux-test-project.readthedocs.io/
GNU General Public License v2.0
2.31k stars 1.01k forks source link

sctp01 1 TBROK: Test didn't report any results #1040

Open Indirajoga opened 1 year ago

Indirajoga commented 1 year ago

-> sctp01 test case is resulting in TBROK

./runltp -f net.features -s sctp01.sh

sctp01 1 TINFO: IPv6 disabled on lhost
sctp01 1 TINFO: Network config (local -- remote):
sctp01 1 TINFO: env4 -- env2
sctp01 1 TINFO: 10.33.2.153/16 -- 10.33.25.12/16
sctp01 1 TINFO: fd00:1:1:1::2/64/ -- fd00:1:1:1::1/64/
sctp01 1 TINFO: trying to disable AppArmor (requires super/root)
sctp01 1 TINFO: timeout per run is 3h 20m 0s
[RUNNING]: test1
sctp01 1 TBROK: Test didn't report any results

Summary:
passed   0
failed   0
broken   1
skipped  0
warnings 0

-> After changing the test function parameter and test function itself to "do_test" from test, the tests are passing.

TST_TESTFUNC="do_test"
TST_NEEDS_TMPDIR=1

do_test()
{
    local opts="$2"

    tst_res TINFO "compare TCP/SCTP performance"

    tst_netload -H $(tst_ipaddr rhost) -T tcp -R 3 $opts
    local res0="$(cat tst_netload.res)"

    tst_netload -S $(tst_ipaddr) -H $(tst_ipaddr rhost) -T sctp -R 3 $opts
    local res1="$(cat tst_netload.res)"

    tst_netload_compare $res0 $res1 -200 200
}
./runltp -f net.features -s sctp01.sh
sctp01 1 TINFO: IPv6 disabled on lhost
sctp01 1 TINFO: Network config (local -- remote):
sctp01 1 TINFO: env4 -- env2
sctp01 1 TINFO: 10.33.2.153/16 -- 10.33.25.12/16
sctp01 1 TINFO: fd00:1:1:1::2/64/ -- fd00:1:1:1::1/64/
sctp01 1 TINFO: trying to disable AppArmor (requires super/root)
sctp01 1 TINFO: timeout per run is 3h 20m 0s
sctp01 1 TINFO: compare TCP/SCTP performance
sctp01 1 TINFO: run server 'netstress -T tcp -D env2 -R 3 -B /tmp/ltp-tbb3sv5HX0/LTP_sctp01.PHDrBzJzUI'
sctp01 1 TINFO: run client 'netstress -l -T tcp -H 10.33.25.12 -D env4 -a 2 -r 2000 -d /tmp/ltp-tbb3sv5HX0/LTP_sctp01.PHDrBzJzUI/tst_netload.res' 5 times
sctp01 1 TPASS: netstress passed, median time 389 ms, data: 387 423 393 389 388
sctp01 1 TINFO: run server 'netstress -T sctp -S 10.33.25.12 -D env2 -R 3 -B /tmp/ltp-tbb3sv5HX0/LTP_sctp01.PHDrBzJzUI'
sctp01 1 TINFO: run client 'netstress -l -T sctp -S 10.33.2.153 -H 10.33.25.12 -D env4 -a 2 -r 2000 -d /tmp/ltp-tbb3sv5HX0/LTP_sctp01.PHDrBzJzUI/tst_netload.res' 5 times
tst_test.c:1558: TINFO: Timeout per run is 0h 25m 00s
netstress.c:923: TINFO: max requests '3'
netstress.c:976: TINFO: SCTP server

Test Start Time: Mon May 22 14:22:58 2023
-----------------------------------------
Testcase                                           Result     Exit Value
--------                                           ------     ----------
sctp01                                             PASS       0

Total Tests: 1
Total Skipped Tests: 0
Total Failures: 0
Kernel Version: 5.14.0-284.11.1.el9_2.ppc64le
Machine Architecture: ppc64le
Hostname: slsdev1.isst.aus.stglabs.ibm.com
Indirajoga commented 1 year ago

@metan-ucw please update

Indirajoga commented 1 year ago

@metan-ucw please update

pevik commented 1 year ago

IMHO there is certainly no reason for this change, test should work even on dash (I suppose you use bash shell). There is /usr/bin/test binary, but test() function takes preference. Could you please report:

ls -la /bin/sh
rpm -qf /bin/sh
bash --version

@wangli5665 It looks the reporter uses RHEL 9, could you please test sctp01.sh? Is there really some clash /usr/bin/test binary vstest() function?

wangli5665 commented 1 year ago

I wasn't able to reproduce that TBROK on RHEL9.2 ppcle64.

# uname -r
5.14.0-284.21.1.el9_2.ppc64le

<<<test_start>>>
tag=sctp01 stime=1687939673
cmdline="sctp01.sh"
contacts=""
analysis=exit
<<<test_output>>>
sctp01 1 TINFO: initialize 'lhost' 'ltp_ns_veth2' interface
sctp01 1 TINFO: add local addr 10.0.0.2/24
sctp01 1 TINFO: add local addr fd00:1:1:1::2/64
sctp01 1 TINFO: initialize 'rhost' 'ltp_ns_veth1' interface
sctp01 1 TINFO: add remote addr 10.0.0.1/24
sctp01 1 TINFO: add remote addr fd00:1:1:1::1/64
sctp01 1 TINFO: Network config (local -- remote):
sctp01 1 TINFO: ltp_ns_veth2 -- ltp_ns_veth1
sctp01 1 TINFO: 10.0.0.2/24 -- 10.0.0.1/24
sctp01 1 TINFO: fd00:1:1:1::2/64 -- fd00:1:1:1::1/64
sctp01 1 TINFO: timeout per run is 0h 5m 0s
sctp01 1 TINFO: compare TCP/SCTP performance
sctp01 1 TINFO: run server 'netstress -T tcp -D ltp_ns_veth1 -R 3 -B /tmp/ltp-J966prso32/LTP_sctp01.MUaV9DtswV'
sctp01 1 TINFO: run client 'netstress -l -T tcp -H 10.0.0.1 -D ltp_ns_veth2 -a 2 -r 2000 -d /tmp/ltp-J966prso32/LTP_sctp01.MUaV9DtswV/tst_netload.res' 5 times
sctp01 1 TPASS: netstress passed, median time 239 ms, data: 235 239 239 239 241
sctp01 1 TINFO: run server 'netstress -T sctp -S 10.0.0.1 -D ltp_ns_veth1 -R 3 -B /tmp/ltp-J966prso32/LTP_sctp01.MUaV9DtswV'
sctp01 1 TINFO: run client 'netstress -l -T sctp -S 10.0.0.2 -H 10.0.0.1 -D ltp_ns_veth2 -a 2 -r 2000 -d /tmp/ltp-J966prso32/LTP_sctp01.MUaV9DtswV/tst_netload.res' 5 times
tst_test.c:1558: TINFO: Timeout per run is 0h 05m 30s
netstress.c:923: TINFO: max requests '3'
netstress.c:976: TINFO: SCTP server
netstress.c:673: TCONF: socket(10, 1, 132) failed: EPROTONOSUPPORT (93)

Summary:
passed   0
failed   0
broken   0
skipped  1
warnings 0
pevik commented 1 year ago

@Indirajoga I guess the problem is somewhere else on your SUT.

Indirajoga commented 1 year ago

IMHO there is certainly no reason for this change, test should work even on dash (I suppose you use bash shell). There is /usr/bin/test binary, but test() function takes preference. Could you please report:

ls -la /bin/sh
rpm -qf /bin/sh
bash --version

@wangli5665 It looks the reporter uses RHEL 9, could you please test sctp01.sh? Is there really some clash /usr/bin/test binary vstest() function?

Please find the output of below commands

root@doodlp95: ls -la /bin/sh lrwxrwxrwx. 1 root root 4 Nov 24 2022 /bin/sh -> bash root@doodlp95: rpm -qf /bin/sh bash-5.1.8-6.el9_1.ppc64le root@doodlp95: bash --version GNU bash, version 5.1.8(1)-release (powerpc64le-redhat-linux-gnu) Copyright (C) 2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html

This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

I am still facing issue with test() function parameter.

NOTE: A similar issue has been observed in git#https://github.com/linux-test-project/ltp/issues/1033.

pevik commented 1 year ago

NOTE: A similar issue has been observed in git##1033.

Good point. Before fixing it this way, could you please thist test file and run it?

$ cat ./foo.sh
test()
{
    echo "test was called with params: $@"
}

test
test foo bar

$ ./foo.sh 
test was called with params: 
test was called with params: foo bar

Is it the output the same? I wonder what exactly is a problem.

Could you please also run:

printf %s\\n "$-"
set +o

and post the output? @wangli5665 could you print output of these two as well?

BTW all of these tests should be affected, can you please try some of them?

$ git grep -l -e TST_TESTFUNC=.test.$ -e TST_TESTFUNC=test$ lib/ testcases/
lib/newlib_tests/shell/tst_all_filesystems.sh
lib/newlib_tests/shell/tst_all_filesystems_skip.sh
lib/newlib_tests/shell/tst_check_driver.sh
lib/newlib_tests/shell/tst_errexit.sh
lib/newlib_tests/shell/tst_format_device.sh
lib/newlib_tests/shell/tst_mount_device.sh
lib/newlib_tests/shell/tst_mount_device_tmpfs.sh
lib/newlib_tests/shell/tst_skip_filesystems.sh
testcases/commands/ar/ar01.sh
testcases/commands/df/df01.sh
testcases/commands/eject/eject-tests.sh
testcases/commands/gzip/gzip_tests.sh
testcases/commands/ld/ld01.sh
testcases/commands/ldd/ldd01.sh
testcases/commands/mkdir/mkdir_tests.sh
testcases/commands/mkfs/mkfs01.sh
testcases/commands/mv/mv_tests.sh
testcases/commands/nm/nm01.sh
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh
testcases/kernel/controllers/cgroup_fj/cgroup_fj_function.sh
testcases/kernel/controllers/memcg/control/memcg_control_test.sh
testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh
testcases/kernel/numa/numa01.sh
testcases/kernel/security/integrity/ima/tests/ima_setup.sh
testcases/network/busy_poll/busy_poll_lib.sh
testcases/network/dccp/dccp01.sh
testcases/network/iproute/ip_tests.sh
testcases/network/iptables/iptables_lib.sh
testcases/network/mpls/mpls01.sh
testcases/network/sctp/sctp01.sh
testcases/network/sockets/bind_noport01.sh
testcases/network/stress/ssh/ssh-stress.sh
testcases/network/tcp_fastopen/tcp_fastopen_run.sh
testcases/network/traceroute/traceroute01.sh
testcases/network/virt/wireguard01.sh
wangli5665 commented 1 year ago

sure, see below:

# ls -la /bin/sh
lrwxrwxrwx. 1 root root 4 Nov 24  2022 /bin/sh -> bash

#  rpm -qf /bin/sh
bash-5.1.8-6.el9_1.ppc64le

# ./foo.sh 
test was called with params: 
test was called with params: foo bar

# printf %s\\n "$-"
himBHs

# set +o
set +o allexport
set -o braceexpand
set -o emacs
set +o errexit
set +o errtrace
set +o functrace
set -o hashall
set -o histexpand
set -o history
set +o ignoreeof
set -o interactive-comments
set +o keyword
set -o monitor
set +o noclobber
set +o noexec
set +o noglob
set +o nolog
set +o notify
set +o nounset
set +o onecmd
set +o physical
set +o pipefail
set +o posix
set +o privileged
set +o verbose
set +o vi
set +o xtrace