Age | Commit message (Collapse) | Author |
|
fixes regression when testing df01.sh
Dash does not like shifting more than possible:
/opt/ltp/testcases/bin/df01.sh: 291: shift: can't shift that many
Fixes: 465faf47f ("shell: Use $TST_FS_TYPE and $TST_DEVICE in tst_mkfs()")
Reported-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
tst_su() was added only into legacy (but at the time the only)
shell API. Last user of it was removed in 0fc9b8624, thus remove it.
Fixes: 0fc9b8624 Remove admin_tools test
Acked-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
as default parameters.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
|
|
+ remove unused local ret variable.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
|
|
and TST_FS_TYPE, TST_MNTPOINT, TST_MNT_PARAMS variables.
TST_FS_TYPE is going to replace FS_TYPE in next commits.
+ document changes.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
[pvorel: Thanks Cyril to point out correct variable names + doc fixes]
Acked-by: Cyril Hrubis <chrubis@suse.cz>
|
|
Report TWARN and don't stop the test in that case.
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Acked-by: Petr Vorel <pvorel@suse.cz>
|
|
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
|
|
This is critical for performance tests, which compare virtual
devices with the real ones. Trigger the fragmentation but keep
the number of fragments at the minimum for those cases.
Also improve the test timing if MTU is not large.
The previous numbers can be restored with TST_NET_MAX_PKT
environment variable.
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
|
|
and load it in tst_test.sh.
In case of TBROK/TFAIL/TWARN it prints warning if AppArmor and/or
SELinux is running and has profiles loaded for anything in
TST_NEEDS_CMDS environment variable. This is due some false positives
because improper usage or bugs in AppArmor profiles (e.g. traceroute,
dnsmasq).
It's also possible trying to disable these LSM via TST_DISABLE_APPARMOR
and TST_DISABLE_SELINUX environment variables.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Acked-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
|
|
When we don't use netns setup, $rparam is empty in tst_set_sysctl(),
and tst_net_run() mistakenly set sysctl command to $rparam. This results
to the following error, $cmd is empty:
bbr01 1 TINFO: timeout per run is 0h 20m 0s
bbr01 1 TINFO: emulate congestion with packet loss 0.5%
bbr01 1 TINFO: compare 'cubic' and 'bbr' congestion alg. results
bbr01 1 TINFO: setting cubic
bbr01 1 TBROK: tst_net_run: command not defined
Fixes: 372d9201c ("net: Add tst_net_run helper")
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
[pvorel: quote -e to make obvious it's parameter for -r, not another parameter]
Acked-by: Petr Vorel <pvorel@suse.cz>
|
|
* Fix the previous patch with tst_ping(), move setting $cmd before
tst_test_cmds().
* Avoid misleading 'iface' in the info messages, rename 'iface' to
'iface/saddr' since we can pass a source address instead of an
interface name.
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
|
|
tst_ping() can be used with the empty TST_IPV6, for example in
the virtual tunnel tests, with IPv6 over IPv4 scenario.
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
|
|
and use it in tst_set_sysctl
+ improve doc of tst_rhost_run()
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Reviewed-by: Alexey Kodanev <alexey.kodanev@oracle.com>
|
|
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
Not only kill command in _tst_do_exit(), also wait has some output is needed to redirect to /dev/null:
/opt/ltp/testcases/bin/tst_test.sh: line 65: 5337 Terminated \
sleep $sec && tst_res TBROK "test killed, timeout!" && kill -9 -$pid (wd: /opt/ltp/testcases/bin)
Fixes: fbea02ab5 ("lib/tst_test.sh: setup timeout per test run for the
shell tests")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
With this patch, "safe" functions such as "ROD" and "tst_rhost_run -s"
can be used in a test cleanup function. In case of an error, "safe"
command won't recursively call cleanup function but will only print
the warning message about the failure.
This behavior is consistent with the LTP C library.
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
|
|
Use LTP_TIMEOUT_MUL environment variable, similar to what we have
in the C library.
Basically, the patch puts the child process with kill command to
the background to signal the test process group processes after
the certain timeout, which is controlled by LTP_TIMEOUT_MUL.
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
|
|
For example, nfs06 produces the warning:
<<<test_output>>>
nfs06 1 TWARN: Reserved variable TST_TMPDIR used!
nfs06 1 TINFO: timeout per run is 0h 20m 0s
nfs06 1 TINFO: setup NFSv3, socket type udp
...
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
|
|
There is no yet any parameter that can switch on/off this. So by
default it is on for all virt tests using tst_netload.
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
|
|
tst_cmd_available() is not available in legacy API,
keep test just for new tests.
Fixes: d57ac0b7a net: Fix missing ping6
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
ping6 is needed for some tst_net.sh based tests (and for
netns_helper.sh, but it handles the dependency itself).
iputils commit ebad35f ("ping: merge `ping6` command into `ping`") [1],
released in s20150815 stopped providing ping6 and left it on
distributions (see also [2]).
Some distros don't create it (or didn't create it in the past [3]),
use workaround and warn once about it (as it's also a bug which should
be fixed).
NOTE: Unfortunately we cannot use 'ping -${TST_IPVER}' as ping got '-6'
switch (as a part of support for IPv6) was in commit 25aaaf4 ("Allow ping
to use IPv6 addresses") [4], released in s20150815 (previous versions
supported only ping6).
[1] https://github.com/iputils/iputils/commit/ebad35fee3de851b809c7b72ccc654a72b6af61d
[2] https://bugzilla.redhat.com/show_bug.cgi?id=617934#c22
[3] https://bugzilla.opensuse.org/show_bug.cgi?id=1017616
[4] https://github.com/iputils/iputils/commit/25aaaf4c58b485a5d9ec758a1f170cc5ec4073c4
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Suggested-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Acked-by: Alexey Kodanev <alexey.kodanev@oracle.com>
|
|
The drivers are checked with 'tst_check_drivers' command.
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Reviewed-by: Petr Vorel <petr.vorel@gmail.com>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
|
|
The drivers are checked with modprobe. If modprobe is not available
on the system, the checks are silently skipped.
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Reviewed-by: Petr Vorel <petr.vorel@gmail.com>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
|
|
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
It should parse iproute commands output and exit the test with TCONF
if there are certain messages returned from iproute/RTNETLINK.
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Acked-by: Petr Vorel <pvorel@suse.cz>
|
|
+ remove it's definition from network stress tests already
converted to the new API.
Trap function can be overwritten in tests, if needed.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
We handle the error already there, so there is no point printing
one more redundant message that doesn't have LTP format.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Suggested-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
|
|
+ tst_cmd_available()
tst_check_cmds() is meant to be a check just for a particular test.
Works like tst_test_cmd(), but instead of tst_brk() calls tst_res().
tst_test_cmds() helper can handle cases when command shell builtin
is not available (e.g. Busybox).
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
|
|
This has been discussed on ML [1] [2] as tst_check_cmds() will be used
for different function.
[1] http://lists.linux.it/pipermail/ltp/2018-July/008801.html
[2] http://lists.linux.it/pipermail/ltp/2018-July/008808.html
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
|
|
The binary tst_supported_fs was missing in the .gitinore file
in testcases/lib, so it should be added.
Signed-off-by: Michael Moese <mmoese@suse.de>
Reviewed-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
|
|
1) Factor out is_supported() and rename it as tst_fs_is_supported(),
so that some tests can check a specified filesystem by it.
2) Add tst_supported_fs binary for shell tests to check a specified
filesystem or all supported fielsystems.
PS: hint messages from tst_supported_fs binary is targeted as stderr,
so we can filter them by "2> /dev/null".
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
|
|
Now that tst_getconf is available to use "sysconf()" function
instead of relying on the application "getconf", let's convert
all the tests to it.
Signed-off-by: Mylène Josserand <mylene.josserand@bootlin.com>
Reviewed-by: Li Wang <liwang@redhat.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
|
|
In some system, "getconf" application may not be installed.
Some tests are using it to retrieve some variables such as the
page size (PAGESIZE).
Create a tst_getconf binary that use sysconf() function to retrieve
these variables instead of relying on "getconf" application that
may not be available.
Add also this new helper in the documentation.
Example:
pagesize=`tst_getconf PAGESIZE`
Signed-off-by: Mylène Josserand <mylene.josserand@bootlin.com>
Reviewed-by: Li Wang <liwang@redhat.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
|
|
to save space
+ add author in few cases.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Reviewed-by: Alexey Kodanev <alexey.kodanev@oracle.com>
|
|
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Reviewed-by: Alexey Kodanev <alexey.kodanev@oracle.com>
|
|
to load it only once.
Some tests (macsec0{1,2}.sh) load tst_net.sh twice via loading from
ipsec_lib.sh and virt_lib.sh. That brings duplicity in some variables
(TST_OPTS) and create infinite loop, as tst_net_setup calls itself.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Suggested-by: Alexey Kodanev <alexey.kodanev@oracle.com>
|
|
to load the library only once.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Suggested-by: Cyril Hrubis <chrubis@suse.cz>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
Reviewed-by: Alexey Kodanev <alexey.kodanev@oracle.com>
|
|
so it does not confuse with output of `tst_device acquire' call.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Suggested-by: Cyril Hrubis <chrubis@suse.cz>
|
|
When tst_device acquire call fails, it outputs into stdout,
therefore the content is actually help message.
=> Check for file presence or error exit code rather than variable not
being empty.
Fixes: c5ac5d712 tst_test.sh: Make use of tst_device helper
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Acked-by: Jan Stancek <jstancek@redhat.com>
|
|
tst_rod call in ROD_SILENT must be quoted as it can have multiline output.
This has been already fixed for tst_test.sh in 5c4a9839d
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
As following patches shows the need to use function with parameter [1],
quotes are needed.
[1] http://lists.linux.it/pipermail/ltp/2018-May/008147.html
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
The commit c2ce4df67d(include: add an exponential backoff macro for
function retry) involves a new MACRO for function retry in C code,
here achieve it in shell lib and gives a introduction in LTP documents.
Signed-off-by: Li Wang <liwang@redhat.com>
Acked-by: Petr Vorel <pvorel@suse.cz>
|
|
Acked-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
Acked-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
This is specific only for shell.
Each run of tst_run gets passed sequence number of a test being run
as '$1' and corresponding part of data from TST_TEST_DATA as '$2'.
Also create internal functions _tst_run_tests() and _tst_run_test()
to reduce duplicity.
Introduced dependencies: cut tr wc.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
Acked-by: Alexey Kodanev <alexey.kodanev@oracle.com>
|
|
resm is for legacy API.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
Acked-by: Alexey Kodanev <alexey.kodanev@oracle.com>
|
|
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
Acked-by: Alexey Kodanev <alexey.kodanev@oracle.com>
|
|
Variables in tst_run and out of functions are visible to the test.
Adding prefix "_tst_" manifest they're private.
NOTE: kept $res from tst_run() as it's going to be moved into separate
function in new commit.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
Acked-by: Alexey Kodanev <alexey.kodanev@oracle.com>
|
|
'basename $0' fails when loaded in command line with bash (at least)
as $0 is invalid ('-bash'):
$ unset TST_ID; export TST_NO_DEFAULT_RUN=1; . tst_test.sh
-bash: tst_ansi_color.sh: No such file or directory
basename: invalid option -- 'b'
Try 'basename --help' for more information.
It's better to TCONF than be without TST_ID.
NOTE: Sourcing tst_test.sh can be needed for network scripts: users
might want to set network variables with tst_net.sh, which itself
sources tst_test.sh.
Reviewed-by: Li Wang <liwang@redhat.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
Reported-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|