shell: Cleanup getopts usage
v2 cover shell: Cleanup getopts usage
Hi,
Changes v1->v2:
* new commits:
shell: Use conditional expansion for library setup/cleanup
doc: Update library API doc
* tst_test.sh: Cleanup getopts usage
* Fix zram01.sh TST_SETUP redefinition
* Fix tst_net.sh for shell API test
* Fix dnsmasq_tests.sh (calling tst_selinux_enforced must be after loaded script)
* Style cleanup in if-lib.sh ipsec_lib.sh
* doc: Update shell API examples
* Updates related to 1st and 2nd commit.
Petr Vorel (4):
shell: Use conditional expansion for library setup/cleanup
doc: Update library API doc
tst_test.sh: Cleanup getopts usage
doc: Update shell API examples
doc/library-api-writing-guidelines.txt | 23 +++++++ doc/shell-test-api.txt | 8 +++ lib/newlib_tests/shell/net/tst_ipaddr_un.sh | 2 +- lib/newlib_tests/shell/net/tst_rhost_run.sh | 2 +- lib/newlib_tests/shell/timeout01.sh | 2 +- lib/newlib_tests/shell/timeout02.sh | 2 +- lib/newlib_tests/shell/timeout03.sh | 2 +- lib/newlib_tests/shell/timeout04.sh | 2 +- lib/newlib_tests/shell/tst_check_driver.sh | 2 +- lib/newlib_tests/shell/tst_check_kconfig01.sh | 3 +- lib/newlib_tests/shell/tst_check_kconfig02.sh | 2 +- lib/newlib_tests/shell/tst_check_kconfig03.sh | 2 +- lib/newlib_tests/shell/tst_check_kconfig04.sh | 2 +- lib/newlib_tests/shell/tst_check_kconfig05.sh | 2 +- lib/newlib_tests/shell/tst_format_device.sh | 2 +- testcases/commands/ar/ar01.sh | 3 +- testcases/commands/cp/cp_tests.sh | 2 +- testcases/commands/cpio/cpio_tests.sh | 3 +- testcases/commands/df/df01.sh | 2 +- testcases/commands/du/du01.sh | 2 +- testcases/commands/eject/eject-tests.sh | 2 +- testcases/commands/file/file01.sh | 3 +- testcases/commands/gdb/gdb01.sh | 3 +- testcases/commands/gzip/gzip_tests.sh | 2 +- testcases/commands/insmod/insmod01.sh | 2 +- testcases/commands/keyctl/keyctl01.sh | 2 +- testcases/commands/ld/ld01.sh | 2 +- testcases/commands/ldd/ldd01.sh | 2 +- testcases/commands/ln/ln_tests.sh | 2 +- testcases/commands/lsmod/lsmod01.sh | 2 +- testcases/commands/mkdir/mkdir_tests.sh | 2 +- testcases/commands/mkfs/mkfs01.sh | 2 +- testcases/commands/mkswap/mkswap01.sh | 2 +- testcases/commands/mv/mv_tests.sh | 2 +- testcases/commands/nm/nm01.sh | 2 +- testcases/commands/shell/shell_pipe01.sh | 3 +- testcases/commands/sysctl/sysctl01.sh | 3 +- testcases/commands/sysctl/sysctl02.sh | 4 +- testcases/commands/tar/tar_tests.sh | 3 +- testcases/commands/unshare/unshare01.sh | 2 +- testcases/commands/unzip/unzip01.sh | 2 +- testcases/commands/vmcp/vmcp_m.sh | 3 +- testcases/commands/wc/wc01.sh | 2 +- testcases/commands/which/which01.sh | 2 +- testcases/kernel/connectors/pec/cn_pec.sh | 3 +- .../kernel/containers/netns/netns_breakns.sh | 11 ++-- .../kernel/containers/netns/netns_comm.sh | 11 ++-- .../kernel/containers/netns/netns_helper.sh | 3 +- .../kernel/containers/netns/netns_sysfs.sh | 3 +- .../cgroup/cgroup_regression_test.sh | 5 +- testcases/kernel/controllers/cgroup_lib.sh | 6 +- .../kernel/controllers/cpuacct/cpuacct.sh | 3 +- .../cpuset/cpuset_regression_test.sh | 4 +- .../memcg/functional/memcg_failcnt.sh | 2 +- .../memcg/functional/memcg_force_empty.sh | 2 +- .../controllers/memcg/functional/memcg_lib.sh | 64 +++++++++---------- .../memcg/functional/memcg_limit_in_bytes.sh | 2 +- .../memcg_max_usage_in_bytes_test.sh | 2 +- .../memcg_memsw_limit_in_bytes_test.sh | 2 +- .../memcg_move_charge_at_immigrate_test.sh | 2 +- .../memcg/functional/memcg_stat_rss.sh | 2 +- .../memcg/functional/memcg_stat_test.sh | 2 +- .../memcg/functional/memcg_subgroup_charge.sh | 2 +- .../functional/memcg_usage_in_bytes_test.sh | 2 +- .../functional/memcg_use_hierarchy_test.sh | 2 +- .../memcg/stress/memcg_stress_test.sh | 5 +- testcases/kernel/controllers/pids/pids.sh | 3 +- .../kernel/device-drivers/rcu/rcu_torture.sh | 3 +- .../kernel/device-drivers/zram/zram01.sh | 5 +- .../kernel/device-drivers/zram/zram02.sh | 2 +- .../kernel/device-drivers/zram/zram_lib.sh | 9 +-- .../kernel/fs/binfmt_misc/binfmt_misc01.sh | 2 +- .../kernel/fs/binfmt_misc/binfmt_misc02.sh | 2 +- .../kernel/fs/binfmt_misc/binfmt_misc_lib.sh | 8 +-- testcases/kernel/fs/fs_bind/bind/fs_bind01.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind02.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind03.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind04.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind05.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind06.sh | 2 +- .../kernel/fs/fs_bind/bind/fs_bind07-2.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind07.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind08.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind09.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind10.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind11.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind12.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind13.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind14.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind15.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind16.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind17.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind18.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind19.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind20.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind21.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind22.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind23.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind24.sh | 2 +- .../fs/fs_bind/cloneNS/fs_bind_cloneNS01.sh | 2 +- .../fs/fs_bind/cloneNS/fs_bind_cloneNS02.sh | 2 +- .../fs/fs_bind/cloneNS/fs_bind_cloneNS03.sh | 2 +- .../fs/fs_bind/cloneNS/fs_bind_cloneNS04.sh | 2 +- .../fs/fs_bind/cloneNS/fs_bind_cloneNS05.sh | 2 +- .../fs/fs_bind/cloneNS/fs_bind_cloneNS06.sh | 2 +- .../fs/fs_bind/cloneNS/fs_bind_cloneNS07.sh | 2 +- testcases/kernel/fs/fs_bind/fs_bind_lib.sh | 11 ++-- .../kernel/fs/fs_bind/fs_bind_regression.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move01.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move02.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move03.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move04.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move05.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move06.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move07.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move08.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move09.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move10.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move11.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move12.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move13.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move14.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move15.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move16.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move17.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move18.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move19.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move20.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move21.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move22.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind01.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind02.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind03.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind04.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind05.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind06.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind07-2.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind07.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind08.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind09.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind10.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind11.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind12.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind13.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind14.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind15.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind16.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind17.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind18.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind19.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind20.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind21.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind22.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind23.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind24.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind25.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind26.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind27.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind28.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind29.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind30.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind31.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind32.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind33.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind34.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind35.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind36.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind37.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind38.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind39.sh | 2 +- testcases/kernel/fs/iso9660/isofs.sh | 3 +- testcases/kernel/fs/linktest/linktest.sh | 3 +- .../fs/quota_remount/quota_remount_test01.sh | 3 +- testcases/kernel/mem/vma/vma05.sh | 3 +- testcases/kernel/numa/numa01.sh | 3 +- .../integrity/ima/tests/evm_overlay.sh | 2 +- .../integrity/ima/tests/ima_conditionals.sh | 3 +- .../security/integrity/ima/tests/ima_kexec.sh | 3 +- .../security/integrity/ima/tests/ima_keys.sh | 4 +- .../integrity/ima/tests/ima_measurements.sh | 3 +- .../integrity/ima/tests/ima_policy.sh | 3 +- .../integrity/ima/tests/ima_selinux.sh | 3 +- .../security/integrity/ima/tests/ima_setup.sh | 4 +- .../security/integrity/ima/tests/ima_tpm.sh | 3 +- .../integrity/ima/tests/ima_violations.sh | 5 +- .../tracing/dynamic_debug/dynamic_debug01.sh | 5 +- testcases/lib/tst_net.sh | 5 +- testcases/lib/tst_test.sh | 29 ++++----- testcases/misc/lvm/cleanup_lvm.sh | 2 +- testcases/misc/lvm/generate_lvm_runfile.sh | 2 +- testcases/misc/lvm/prepare_lvm.sh | 2 +- testcases/network/busy_poll/busy_poll01.sh | 3 +- testcases/network/busy_poll/busy_poll02.sh | 3 +- testcases/network/busy_poll/busy_poll03.sh | 3 +- testcases/network/busy_poll/busy_poll_lib.sh | 10 +-- testcases/network/dccp/dccp01.sh | 2 +- testcases/network/dhcp/dhcp_lib.sh | 12 ++-- testcases/network/dhcp/dhcpd_tests.sh | 6 +- testcases/network/dhcp/dnsmasq_tests.sh | 28 ++++---- testcases/network/iproute/ip_tests.sh | 2 +- testcases/network/iptables/iptables01.sh | 1 - testcases/network/iptables/iptables_lib.sh | 6 +- testcases/network/iptables/nft01.sh | 3 +- testcases/network/mpls/mpls01.sh | 2 +- testcases/network/mpls/mpls02.sh | 3 +- testcases/network/mpls/mpls03.sh | 5 +- testcases/network/mpls/mpls04.sh | 5 +- testcases/network/mpls/mpls_lib.sh | 4 +- .../network/multicast/mc_cmds/mc_cmds.sh | 6 +- .../network/multicast/mc_commo/mc_commo.sh | 5 +- .../network/multicast/mc_member/mc_member.sh | 6 +- testcases/network/nfs/fsx-linux/fsx.sh | 3 +- testcases/network/nfs/nfs_stress/nfs01.sh | 3 +- testcases/network/nfs/nfs_stress/nfs02.sh | 3 +- testcases/network/nfs/nfs_stress/nfs03.sh | 3 +- testcases/network/nfs/nfs_stress/nfs04.sh | 2 +- testcases/network/nfs/nfs_stress/nfs05.sh | 3 +- testcases/network/nfs/nfs_stress/nfs06.sh | 2 +- testcases/network/nfs/nfs_stress/nfs07.sh | 8 +-- testcases/network/nfs/nfs_stress/nfs_lib.sh | 4 +- testcases/network/nfs/nfslock01/nfslock01.sh | 3 +- testcases/network/nfs/nfsstat01/nfsstat01.sh | 3 +- .../network/rpc/basic_tests/rpc01/rpc01.sh | 2 +- testcases/network/rpc/basic_tests/rpc_lib.sh | 5 +- .../rpc/basic_tests/rpcinfo/rpcinfo01.sh | 2 +- .../network/rpc/basic_tests/rup/rup01.sh | 1 - .../rpc/basic_tests/rusers/rusers01.sh | 1 - testcases/network/rpc/rpc-tirpc/rpc_test.sh | 2 +- testcases/network/sctp/sctp01.sh | 2 +- testcases/network/sockets/bind_noport01.sh | 2 +- .../stress/broken_ip/broken_ip-checksum.sh | 2 +- .../stress/broken_ip/broken_ip-dstaddr.sh | 2 +- .../stress/broken_ip/broken_ip-fragment.sh | 2 +- .../network/stress/broken_ip/broken_ip-ihl.sh | 2 +- .../stress/broken_ip/broken_ip-nexthdr.sh | 10 +-- .../stress/broken_ip/broken_ip-plen.sh | 2 +- .../stress/broken_ip/broken_ip-protcol.sh | 2 +- .../stress/broken_ip/broken_ip-version.sh | 2 +- testcases/network/stress/dccp/dccp_ipsec.sh | 4 +- .../network/stress/dccp/dccp_ipsec_vti.sh | 4 +- testcases/network/stress/dns/dns-stress.sh | 6 +- .../network/stress/ftp/ftp-download-stress.sh | 4 +- .../network/stress/ftp/ftp-upload-stress.sh | 4 +- testcases/network/stress/http/http-stress.sh | 4 +- .../network/stress/icmp/icmp-uni-basic.sh | 4 +- testcases/network/stress/icmp/icmp-uni-vti.sh | 4 +- .../stress/interface/if-addr-adddel.sh | 4 +- .../stress/interface/if-addr-addlarge.sh | 4 +- testcases/network/stress/interface/if-lib.sh | 12 ++-- .../network/stress/interface/if-mtu-change.sh | 4 +- .../stress/interface/if-route-adddel.sh | 4 +- .../stress/interface/if-route-addlarge.sh | 4 +- .../network/stress/interface/if-updown.sh | 4 +- .../stress/interface/if4-addr-change.sh | 2 +- testcases/network/stress/ipsec/ipsec_lib.sh | 15 +++-- .../mcast-group-multiple-socket.sh | 2 +- .../grp-operation/mcast-group-same-group.sh | 2 +- .../mcast-group-single-socket.sh | 2 +- .../mcast-group-source-filter.sh | 2 +- .../multicast/grp-operation/mcast-lib.sh | 6 +- .../multicast/packet-flood/mcast-pktfld01.sh | 2 +- .../multicast/packet-flood/mcast-pktfld02.sh | 2 +- .../multicast/query-flood/mcast-queryfld01.sh | 2 +- .../multicast/query-flood/mcast-queryfld02.sh | 2 +- .../multicast/query-flood/mcast-queryfld03.sh | 2 +- .../multicast/query-flood/mcast-queryfld04.sh | 2 +- .../multicast/query-flood/mcast-queryfld05.sh | 2 +- .../multicast/query-flood/mcast-queryfld06.sh | 2 +- .../network/stress/ns-tools/tst_net_stress.sh | 4 +- .../network/stress/route/route-change-dst.sh | 6 +- .../network/stress/route/route-change-gw.sh | 6 +- .../network/stress/route/route-change-if.sh | 6 +- .../stress/route/route-change-netlink-dst.sh | 4 +- .../stress/route/route-change-netlink-gw.sh | 4 +- .../stress/route/route-change-netlink-if.sh | 4 +- testcases/network/stress/route/route-lib.sh | 5 +- .../network/stress/route/route-redirect.sh | 4 +- testcases/network/stress/sctp/sctp_ipsec.sh | 4 +- .../network/stress/sctp/sctp_ipsec_vti.sh | 4 +- testcases/network/stress/ssh/ssh-stress.sh | 2 +- testcases/network/stress/tcp/tcp_ipsec.sh | 4 +- testcases/network/stress/tcp/tcp_ipsec_vti.sh | 4 +- testcases/network/stress/udp/udp_ipsec.sh | 4 +- testcases/network/stress/udp/udp_ipsec_vti.sh | 4 +- testcases/network/tcp_cc/bbr01.sh | 3 +- testcases/network/tcp_cc/bbr02.sh | 4 +- testcases/network/tcp_cc/dctcp01.sh | 3 +- testcases/network/tcp_cc/tcp_cc_lib.sh | 5 +- testcases/network/tcp_cmds/arping/arping01.sh | 2 +- .../network/tcp_cmds/clockdiff/clockdiff01.sh | 2 +- testcases/network/tcp_cmds/host/host01.sh | 2 +- .../network/tcp_cmds/ipneigh/ipneigh01.sh | 2 +- .../network/tcp_cmds/netstat/netstat01.sh | 2 +- testcases/network/tcp_cmds/ping/ping01.sh | 2 +- testcases/network/tcp_cmds/ping/ping02.sh | 2 +- .../network/tcp_cmds/sendfile/sendfile01.sh | 2 +- testcases/network/tcp_cmds/tc/tc01.sh | 3 +- .../network/tcp_cmds/tcpdump/tcpdump01.sh | 3 +- testcases/network/tcp_cmds/telnet/telnet01.sh | 3 +- .../network/tcp_cmds/tracepath/tracepath01.sh | 2 +- .../network/tcp_fastopen/tcp_fastopen_run.sh | 2 +- testcases/network/traceroute/traceroute01.sh | 2 +- testcases/network/virt/fou01.sh | 2 +- testcases/network/virt/geneve01.sh | 9 ++- testcases/network/virt/geneve02.sh | 14 ++-- testcases/network/virt/gre01.sh | 2 +- testcases/network/virt/gre02.sh | 2 +- testcases/network/virt/ipvlan01.sh | 2 +- testcases/network/virt/macsec01.sh | 1 - testcases/network/virt/macsec02.sh | 1 - testcases/network/virt/macsec03.sh | 3 +- testcases/network/virt/macsec_lib.sh | 11 ++-- testcases/network/virt/macvlan01.sh | 2 +- testcases/network/virt/macvtap01.sh | 2 +- testcases/network/virt/sit01.sh | 2 +- testcases/network/virt/virt_lib.sh | 36 +++++------ testcases/network/virt/vlan01.sh | 2 +- testcases/network/virt/vlan02.sh | 2 +- testcases/network/virt/vlan03.sh | 2 +- testcases/network/virt/vxlan01.sh | 9 ++- testcases/network/virt/vxlan02.sh | 5 +- testcases/network/virt/vxlan03.sh | 2 +- testcases/network/virt/vxlan04.sh | 2 +- testcases/network/virt/wireguard01.sh | 3 +- testcases/network/virt/wireguard02.sh | 6 +- testcases/network/virt/wireguard_lib.sh | 4 +- testcases/network/xinetd/xinetd_tests.sh | 2 +- 327 files changed, 557 insertions(+), 590 deletions(-)
Signature · 5 lines
2.35.3 -- Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH v2 1/4 shell: Use conditional expansion for library setup/cleanup
To avoid surprises when test specific setup/cleanup function is redefined by shell library.
Although there is not an optimal general solution because usually test which have specific setup/cleanup also needs to call library setup/cleanup, but it's better not to require TST_{SETUP,CLEANUP} to be on specific place.
Added to all shell libraries, regardless it's required or not.
---
* New in v2
testcases/kernel/controllers/memcg/functional/memcg_lib.sh | 4 ++-- testcases/kernel/device-drivers/zram/zram01.sh | 4 ++-- testcases/kernel/device-drivers/zram/zram_lib.sh | 6 +++--- testcases/kernel/fs/binfmt_misc/binfmt_misc_lib.sh | 4 ++-- testcases/kernel/fs/fs_bind/fs_bind_lib.sh | 4 ++-- testcases/network/busy_poll/busy_poll_lib.sh | 5 +++-- testcases/network/dhcp/dhcp_lib.sh | 6 +++--- testcases/network/iptables/iptables_lib.sh | 1 + testcases/network/nfs/nfs_stress/nfs_lib.sh | 1 + testcases/network/stress/interface/if-lib.sh | 7 +++++-- testcases/network/stress/ipsec/ipsec_lib.sh | 2 +- testcases/network/virt/macsec_lib.sh | 6 +++--- testcases/network/virt/virt_lib.sh | 2 +- testcases/network/virt/wireguard_lib.sh | 1 + 14 files changed, 30 insertions(+), 23 deletions(-)
testcases/kernel/controllers/memcg/functional/memcg_lib.sh +2 -2
@@ -10,8 +10,8 @@ TST_NEEDS_CHECKPOINTS=1 TST_NEEDS_ROOT=1 TST_NEEDS_TMPDIR=1 TST_NEEDS_CMDS="killall find kill" -TST_CLEANUP=memcg_cleanup -TST_SETUP=memcg_setup +TST_SETUP="${TST_SETUP:-memcg_setup}" +TST_CLEANUP="${TST_CLEANUP:-memcg_cleanup}" TST_TESTFUNC=memcg_testfunc MEMCG_SHMMAX=${MEMCG_SHMMAX:-0}
testcases/kernel/device-drivers/zram/zram01.sh +2 -2
@@ -1,6 +1,6 @@ #!/bin/sh # Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved. -# Copyright (c) 2019-2021 Petr Vorel <[email protected]> +# Copyright (c) 2019-2022 Petr Vorel <[email protected]> # Author: Alexey Kodanev <[email protected]> # # Test creates several zram devices with different filesystems on them.
@@ -9,8 +9,8 @@ TST_CNT=7 TST_TESTFUNC="do_test" TST_NEEDS_CMDS="awk bc dd" -. zram_lib.sh TST_SETUP="setup" +. zram_lib.sh check_space_for_btrfs() {
testcases/kernel/device-drivers/zram/zram_lib.sh +3 -3
@@ -1,6 +1,6 @@ #!/bin/sh # Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved. -# Copyright (c) 2019-2021 Petr Vorel <[email protected]> +# Copyright (c) 2019-2022 Petr Vorel <[email protected]> # Author: Alexey Kodanev <[email protected]> dev_makeswap=-1
@@ -12,8 +12,8 @@ sys_control=-1 TST_NEEDS_TMPDIR=1 TST_NEEDS_ROOT=1 -TST_SETUP="zram_load" -TST_CLEANUP="zram_cleanup" +TST_SETUP="${TST_SETUP:-zram_load}" +TST_CLEANUP="${TST_CLEANUP:-zram_cleanup}" TST_NEEDS_DRIVERS="zram" . tst_test.sh
testcases/kernel/fs/binfmt_misc/binfmt_misc_lib.sh +2 -2
@@ -4,8 +4,8 @@ # Copyright (c) 2019 FUJITSU LIMITED. All rights reserved. # Author: Xiao Yang <[email protected]> -TST_SETUP=binfmt_misc_setup -TST_CLEANUP=binfmt_misc_cleanup +TST_SETUP="${TST_SETUP:-binfmt_misc_setup}" +TST_CLEANUP="${TST_CLEANUP:-binfmt_misc_cleanup}" TST_NEEDS_DRIVERS="binfmt_misc" TST_NEEDS_TMPDIR=1 TST_NEEDS_ROOT=1
testcases/kernel/fs/fs_bind/fs_bind_lib.sh +2 -2
@@ -7,8 +7,8 @@ TST_NEEDS_TMPDIR=1 TST_NEEDS_ROOT=1 TST_MIN_KVER=2.6.15 -TST_SETUP=fs_bind_setup -TST_CLEANUP=fs_bind_cleanup +TST_SETUP="${TST_SETUP:-fs_bind_setup}" +TST_CLEANUP="${TST_CLEANUP:-fs_bind_cleanup}" TST_TESTFUNC=fs_bind_test TST_NEEDS_CMDS="mount umount awk sed"
testcases/network/busy_poll/busy_poll_lib.sh +3 -2
@@ -1,10 +1,11 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later # Copyright (c) 2016-2018 Oracle and/or its affiliates. All Rights Reserved. +# Copyright (c) Linux Test Project, 2016-2022 -TST_SETUP="setup" TST_TESTFUNC="test" -TST_CLEANUP="cleanup" +TST_SETUP="${TST_SETUP:-setup}" +TST_CLEANUP="${TST_CLEANUP:-cleanup}" TST_MIN_KVER="3.11" TST_NEEDS_TMPDIR=1 TST_NEEDS_ROOT=1
testcases/network/dhcp/dhcp_lib.sh +3 -3
@@ -1,11 +1,11 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later # Copyright (c) 2014-2018 Oracle and/or its affiliates. All Rights Reserved. -# Copyright (c) 2018 Petr Vorel <[email protected]> +# Copyright (c) 2018-2022 Petr Vorel <[email protected]> # Author: Alexey Kodanev [email protected] -TST_SETUP="dhcp_lib_setup" -TST_CLEANUP="dhcp_lib_cleanup" +TST_SETUP="${TST_SETUP:-dhcp_lib_setup}" +TST_CLEANUP="${TST_CLEANUP:-dhcp_lib_cleanup}" TST_TESTFUNC="test01" TST_NEEDS_TMPDIR=1 TST_NEEDS_ROOT=1
testcases/network/iptables/iptables_lib.sh +1 -0
@@ -2,6 +2,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later # Copyright (c) 2018-2019 Oracle and/or its affiliates. All Rights Reserved. # Copyright (c) International Business Machines Corp., 2001 +# Copyright (c) Linux Test Project, 2019-2022 # # Author: Jan 20 2004 Hubert Lin <[email protected]> # <[email protected]>
testcases/network/nfs/nfs_stress/nfs_lib.sh +1 -0
@@ -1,5 +1,6 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) Linux Test Project, 2016-2022 # Copyright (c) 2015-2018 Oracle and/or its affiliates. All Rights Reserved. # Copyright (c) International Business Machines Corp., 2001
testcases/network/stress/interface/if-lib.sh +5 -2
@@ -5,7 +5,11 @@ CMD="${CMD:-ip}" -TST_SETUP="${TST_SETUP:-if_setup}" +if [ -z "$TST_SETUP" ]; then + TST_SETUP="if_setup" + TST_CLEANUP="${TST_CLEANUP:-netstress_cleanup}" +fi + TST_TESTFUNC="test_body" TST_PARSE_ARGS="if_parse_args" TST_USAGE="if_usage"
@@ -32,7 +36,6 @@ if_setup() tst_require_cmds "$CMD" netstress_setup - TST_CLEANUP="${TST_CLEANUP:-netstress_cleanup}" } if_cleanup_restore()
testcases/network/stress/ipsec/ipsec_lib.sh +1 -1
@@ -1,6 +1,6 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later -# Copyright (c) 2018 Petr Vorel <[email protected]> +# Copyright (c) 2018-2022 Petr Vorel <[email protected]> # Copyright (c) 2016 Red Hat Inc., All Rights Reserved. # Copyright (c) 2016 Oracle and/or its affiliates. All Rights Reserved. # Author: Hangbin Liu <[email protected]>
testcases/network/virt/macsec_lib.sh +3 -3
@@ -1,6 +1,6 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later -# Copyright (c) 2018 Petr Vorel <[email protected]> +# Copyright (c) 2018-2022 Petr Vorel <[email protected]> # Copyright (c) 2014-2017 Oracle and/or its affiliates. All Rights Reserved. # Author: Alexey Kodanev <[email protected]>
@@ -10,8 +10,8 @@ IPSEC_MODE="transport" TST_NEEDS_TMPDIR=1 TST_TESTFUNC=virt_netperf_msg_sizes -TST_SETUP=macsec_lib_setup -TST_CLEANUP=macsec_lib_cleanup +TST_SETUP="${TST_SETUP:-macsec_lib_setup}" +TST_CLEANUP="${TST_CLEANUP:-macsec_lib_cleanup}" TST_NEEDS_DRIVERS="macsec" . ipsec_lib.sh . virt_lib.sh
testcases/network/virt/virt_lib.sh +1 -1
@@ -1,6 +1,6 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later -# Copyright (c) 2018-2019 Petr Vorel <[email protected]> +# Copyright (c) 2018-2022 Petr Vorel <[email protected]> # Copyright (c) 2014-2021 Oracle and/or its affiliates. All Rights Reserved. # Author: Alexey Kodanev <[email protected]> #
testcases/network/virt/wireguard_lib.sh +1 -0
@@ -1,5 +1,6 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) Linux Test Project, 2022 # Copyright (c) 2020 Oracle and/or its affiliates. All Rights Reserved. TST_NEEDS_TMPDIR=1
Signature · 5 lines
2.35.3 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH v2 1/4] shell: Use conditional expansion for library setup/cleanup
Hi,
there are a few files where the only change is in the copyright comment. I'll leave it up to you whether you want to keep those changes or drop them. I've also added a suggestion for another improvement in a separate patchset below.
I've also run new tests on this patchset and everything seems to work. Overall:
Quoted 125 lines · Petr Vorel
To avoid surprises when test specific setup/cleanup function is redefined by shell library.
Although there is not an optimal general solution because usually test which have specific setup/cleanup also needs to call library setup/cleanup, but it's better not to require TST_{SETUP,CLEANUP} to be on specific place.
Added to all shell libraries, regardless it's required or not.
Suggested-by Martin Doucha <[email protected]>Signed-off-by Petr Vorel <[email protected]>---
* New in v2testcases/kernel/controllers/memcg/functional/memcg_lib.sh | 4 ++-- testcases/kernel/device-drivers/zram/zram01.sh | 4 ++-- testcases/kernel/device-drivers/zram/zram_lib.sh | 6 +++--- testcases/kernel/fs/binfmt_misc/binfmt_misc_lib.sh | 4 ++-- testcases/kernel/fs/fs_bind/fs_bind_lib.sh | 4 ++-- testcases/network/busy_poll/busy_poll_lib.sh | 5 +++-- testcases/network/dhcp/dhcp_lib.sh | 6 +++--- testcases/network/iptables/iptables_lib.sh | 1 + testcases/network/nfs/nfs_stress/nfs_lib.sh | 1 + testcases/network/stress/interface/if-lib.sh | 7 +++++-- testcases/network/stress/ipsec/ipsec_lib.sh | 2 +- testcases/network/virt/macsec_lib.sh | 6 +++--- testcases/network/virt/virt_lib.sh | 2 +- testcases/network/virt/wireguard_lib.sh | 1 + 14 files changed, 30 insertions(+), 23 deletions(-)testcases/kernel/controllers/memcg/functional/memcg_lib.sh +2
-2@@ -10,8 +10,8 @@ TST_NEEDS_CHECKPOINTS=1 TST_NEEDS_ROOT=1 TST_NEEDS_TMPDIR=1 TST_NEEDS_CMDS="killall find kill" -TST_CLEANUP=memcg_cleanup -TST_SETUP=memcg_setup +TST_SETUP="${TST_SETUP:-memcg_setup}" +TST_CLEANUP="${TST_CLEANUP:-memcg_cleanup}" TST_TESTFUNC=memcg_testfunc MEMCG_SHMMAX=${MEMCG_SHMMAX:-0}testcases/kernel/device-drivers/zram/zram01.sh +2
-2@@ -1,6 +1,6 @@ #!/bin/sh # Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved. -# Copyright (c) 2019-2021 Petr Vorel <[email protected]> +# Copyright (c) 2019-2022 Petr Vorel <[email protected]> # Author: Alexey Kodanev <[email protected]> # # Test creates several zram devices with different filesystems on them.@@ -9,8 +9,8 @@ TST_CNT=7 TST_TESTFUNC="do_test" TST_NEEDS_CMDS="awk bc dd" -. zram_lib.sh TST_SETUP="setup" +. zram_lib.sh check_space_for_btrfs() {testcases/kernel/device-drivers/zram/zram_lib.sh +3
-3@@ -1,6 +1,6 @@ #!/bin/sh # Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved. -# Copyright (c) 2019-2021 Petr Vorel <[email protected]> +# Copyright (c) 2019-2022 Petr Vorel <[email protected]> # Author: Alexey Kodanev <[email protected]> dev_makeswap=-1@@ -12,8 +12,8 @@ sys_control=-1 TST_NEEDS_TMPDIR=1 TST_NEEDS_ROOT=1 -TST_SETUP="zram_load" -TST_CLEANUP="zram_cleanup" +TST_SETUP="${TST_SETUP:-zram_load}" +TST_CLEANUP="${TST_CLEANUP:-zram_cleanup}" TST_NEEDS_DRIVERS="zram" . tst_test.shtestcases/kernel/fs/binfmt_misc/binfmt_misc_lib.sh +2
-2@@ -4,8 +4,8 @@ # Copyright (c) 2019 FUJITSU LIMITED. All rights reserved. # Author: Xiao Yang <[email protected]> -TST_SETUP=binfmt_misc_setup -TST_CLEANUP=binfmt_misc_cleanup +TST_SETUP="${TST_SETUP:-binfmt_misc_setup}" +TST_CLEANUP="${TST_CLEANUP:-binfmt_misc_cleanup}" TST_NEEDS_DRIVERS="binfmt_misc" TST_NEEDS_TMPDIR=1 TST_NEEDS_ROOT=1testcases/kernel/fs/fs_bind/fs_bind_lib.sh +2
-2@@ -7,8 +7,8 @@ TST_NEEDS_TMPDIR=1 TST_NEEDS_ROOT=1 TST_MIN_KVER=2.6.15 -TST_SETUP=fs_bind_setup -TST_CLEANUP=fs_bind_cleanup +TST_SETUP="${TST_SETUP:-fs_bind_setup}" +TST_CLEANUP="${TST_CLEANUP:-fs_bind_cleanup}" TST_TESTFUNC=fs_bind_test TST_NEEDS_CMDS="mount umount awk sed"testcases/network/busy_poll/busy_poll_lib.sh +0
-0
testcases/network/busy_poll/busy_poll_lib.sh line 8
Quoted 10 lines
testcases/network/busy_poll/busy_poll_lib.sh +3
-2@@ -1,10 +1,11 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later # Copyright (c) 2016-2018 Oracle and/or its affiliates. All Rights Reserved. +# Copyright (c) Linux Test Project, 2016-2022 -TST_SETUP="setup" TST_TESTFUNC="test" -TST_CLEANUP="cleanup" +TST_SETUP="${TST_SETUP:-setup}" +TST_CLEANUP="${TST_CLEANUP:-cleanup}"
The setup() and cleanup() functions here should get a prefix, otherwise we're asking for duplicate definitions. But that can be added in a separate patchset.
Quoted 128 lines
testcases/network/busy_poll/busy_poll_lib.sh +0
-0TST_MIN_KVER="3.11" TST_NEEDS_TMPDIR=1 TST_NEEDS_ROOT=1testcases/network/dhcp/dhcp_lib.sh +3
-3@@ -1,11 +1,11 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later # Copyright (c) 2014-2018 Oracle and/or its affiliates. All Rights Reserved. -# Copyright (c) 2018 Petr Vorel <[email protected]> +# Copyright (c) 2018-2022 Petr Vorel <[email protected]> # Author: Alexey Kodanev [email protected] -TST_SETUP="dhcp_lib_setup" -TST_CLEANUP="dhcp_lib_cleanup" +TST_SETUP="${TST_SETUP:-dhcp_lib_setup}" +TST_CLEANUP="${TST_CLEANUP:-dhcp_lib_cleanup}" TST_TESTFUNC="test01" TST_NEEDS_TMPDIR=1 TST_NEEDS_ROOT=1testcases/network/iptables/iptables_lib.sh +1
-0@@ -2,6 +2,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later # Copyright (c) 2018-2019 Oracle and/or its affiliates. All Rights Reserved. # Copyright (c) International Business Machines Corp., 2001 +# Copyright (c) Linux Test Project, 2019-2022 # # Author: Jan 20 2004 Hubert Lin <[email protected]> # <[email protected]>testcases/network/nfs/nfs_stress/nfs_lib.sh +1
-0@@ -1,5 +1,6 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) Linux Test Project, 2016-2022 # Copyright (c) 2015-2018 Oracle and/or its affiliates. All Rights Reserved. # Copyright (c) International Business Machines Corp., 2001testcases/network/stress/interface/if-lib.sh +5
-2@@ -5,7 +5,11 @@ CMD="${CMD:-ip}" -TST_SETUP="${TST_SETUP:-if_setup}" +if [ -z "$TST_SETUP" ]; then + TST_SETUP="if_setup" + TST_CLEANUP="${TST_CLEANUP:-netstress_cleanup}" +fi + TST_TESTFUNC="test_body" TST_PARSE_ARGS="if_parse_args" TST_USAGE="if_usage"@@ -32,7 +36,6 @@ if_setup() tst_require_cmds "$CMD" netstress_setup - TST_CLEANUP="${TST_CLEANUP:-netstress_cleanup}" } if_cleanup_restore()testcases/network/stress/ipsec/ipsec_lib.sh +1
-1@@ -1,6 +1,6 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later -# Copyright (c) 2018 Petr Vorel <[email protected]> +# Copyright (c) 2018-2022 Petr Vorel <[email protected]> # Copyright (c) 2016 Red Hat Inc., All Rights Reserved. # Copyright (c) 2016 Oracle and/or its affiliates. All Rights Reserved. # Author: Hangbin Liu <[email protected]>testcases/network/virt/macsec_lib.sh +3
-3@@ -1,6 +1,6 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later -# Copyright (c) 2018 Petr Vorel <[email protected]> +# Copyright (c) 2018-2022 Petr Vorel <[email protected]> # Copyright (c) 2014-2017 Oracle and/or its affiliates. All Rights Reserved. # Author: Alexey Kodanev <[email protected]>@@ -10,8 +10,8 @@ IPSEC_MODE="transport" TST_NEEDS_TMPDIR=1 TST_TESTFUNC=virt_netperf_msg_sizes -TST_SETUP=macsec_lib_setup -TST_CLEANUP=macsec_lib_cleanup +TST_SETUP="${TST_SETUP:-macsec_lib_setup}" +TST_CLEANUP="${TST_CLEANUP:-macsec_lib_cleanup}" TST_NEEDS_DRIVERS="macsec" . ipsec_lib.sh . virt_lib.shtestcases/network/virt/virt_lib.sh +1
-1@@ -1,6 +1,6 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later -# Copyright (c) 2018-2019 Petr Vorel <[email protected]> +# Copyright (c) 2018-2022 Petr Vorel <[email protected]> # Copyright (c) 2014-2021 Oracle and/or its affiliates. All Rights Reserved. # Author: Alexey Kodanev <[email protected]> #testcases/network/virt/wireguard_lib.sh +1
-0@@ -1,5 +1,6 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) Linux Test Project, 2022 # Copyright (c) 2020 Oracle and/or its affiliates. All Rights Reserved. TST_NEEDS_TMPDIR=1
Signature · 10 lines
Martin Doucha [email protected] QA Engineer for Software Maintenance SUSE LINUX, s.r.o. CORSO IIa Krizikova 148/34 186 00 Prague 8 Czech Republic -- Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH v2 1/4] shell: Use conditional expansion for library setup/cleanup
Hi Martin,
Quoted 4 lines
Hi,
there are a few files where the only change is in the copyright comment. I'll leave it up to you whether you want to keep those changes or drop them.
Very good point, I'll remove these changes before merging.
Quoted 2 lines
I've also added a suggestion for another improvement in a separate patchset below.
Thx!
Quoted 4 lines
I've also run new tests on this patchset and everything seems to work. Overall:
Reviewed-by Martin Doucha <[email protected]>
Thanks a lot for testing and review!
...
Quoted 7 lines
Quoted 6 lines
+++
b/testcases/network/busy_poll/busy_poll_lib.shtestcases/network/busy_poll/busy_poll_lib.sh +1
-0@@ -1,10 +1,11 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later # Copyright (c) 2016-2018 Oracle and/or its affiliates. All Rights Reserved. +# Copyright (c) Linux Test Project, 2016-2022
Quoted 9 lines
testcases/network/busy_poll/busy_poll_lib.sh line 8
Quoted 5 lines
testcases/network/busy_poll/busy_poll_lib.sh +2
-2-TST_SETUP="setup" TST_TESTFUNC="test" -TST_CLEANUP="cleanup" +TST_SETUP="${TST_SETUP:-setup}" +TST_CLEANUP="${TST_CLEANUP:-cleanup}"The
setup()andcleanup()functions here should get a prefix, otherwise we're asking for duplicate definitions. But that can be added in a separate patchset.
Very good point, thx! Yes, I'll send it as a separate patch.
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH v2 1/4] shell: Use conditional expansion for library setup/cleanup
In reply to Martin DouchaHi Martin,
Quoted 1 line
Quoted 1 line
testcases/network/busy_poll/busy_poll_lib.sh +0
-0
...
Quoted 9 lines
testcases/network/busy_poll/busy_poll_lib.sh line 8
Quoted 5 lines
testcases/network/busy_poll/busy_poll_lib.sh +2
-2-TST_SETUP="setup" TST_TESTFUNC="test" -TST_CLEANUP="cleanup" +TST_SETUP="${TST_SETUP:-setup}" +TST_CLEANUP="${TST_CLEANUP:-cleanup}"The
setup()andcleanup()functions here should get a prefix, otherwise we're asking for duplicate definitions. But that can be added in a separate patchset.
Actually setup() and cleanup() are functions in the test, thus the name is correct, This was written by Alexey, but I also had this approach to put the same variables into library. Test defines many variables, thus I'd keep them in the library:
TST_TESTFUNC="test"
TST_SETUP="${TST_SETUP:-setup}"
TST_CLEANUP="${TST_CLEANUP:-cleanup}"
TST_MIN_KVER="3.11"
TST_NEEDS_TMPDIR=1
TST_NEEDS_ROOT=1
TST_NEEDS_CMDS="pkill sysctl ethtool"
# for more stable results set to a single thread TST_NETLOAD_CLN_NUMBER=1
But I'd suggest to change:
# setup and cleanup defined in the test TST_SETUP="setup" TST_CLEANUP="cleanup"
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH v2 2/4 doc: Update library API doc
In reply to Petr Vorelabout conditional expansion for TST_{SETUP,CLEANUP}.
---
* New in v2
doc/library-api-writing-guidelines.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
doc/library-api-writing-guidelines.txt +20 -0
@@ -61,3 +61,23 @@ API source code is in 'tst_test.sh', 'tst_security.sh' and 'tst_net.sh' Changes in the shell API should not introduce uncommon dependencies (use basic commands installed everywhere by default). + +3.1 Shell libraries +~~~~~~~~~~~~~~~~~~~ + +Besides shell API libraries in 'testcases/lib' it's worth to put common code +for particular tests into shell library. The filename should end '_lib.sh', +they should load 'tst_test.sh' or 'tst_net.sh'. + +Shell libraries should have conditional expansion for 'TST_SETUP' or 'TST_CLEANUP', +to avoid surprises when test specific setup/cleanup function is redefined by +shell library. + +[source,sh] +------------------------------------------------------------------------------- +# ipsec_lib.sh +# SPDX-License-Identifier: GPL-2.0-or-later +TST_SETUP=${TST_SETUP:-ipsec_lib_setup} +. tst_test.sh +... +-------------------------------------------------------------------------------
Signature · 5 lines
2.35.3 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH v2 2/4] doc: Update library API doc
Hi,
small nit below, otherwise:
Quoted 14 lines · Petr Vorel
about conditional expansion for TST_{SETUP,CLEANUP}.
Signed-off-by Petr Vorel <[email protected]>---
* New in v2doc/library-api-writing-guidelines.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)doc/library-api-writing-guidelines.txt +0
-0
doc/library-api-writing-guidelines.txt API source code is in 'tst_test.sh', 'tst_security.sh' and 'tst_net.sh' · line 70
Quoted 10 lines
doc/library-api-writing-guidelines.txt +7
-0@@ -61,3 +61,23 @@ API source code is in 'tst_test.sh', 'tst_security.sh' and 'tst_net.sh' Changes in the shell API should not introduce uncommon dependencies (use basic commands installed everywhere by default). + +3.1 Shell libraries +~~~~~~~~~~~~~~~~~~~ + +Besides shell API libraries in 'testcases/lib' it's worth to put common code +for particular tests into shell library. The filename should end '_lib.sh', +they should load 'tst_test.sh' or 'tst_net.sh'.
Better wording:
Aside from shell API libraries in 'testcases/lib', it's worth putting common code for a group of tests into a shell library. The filename should end with '_lib.sh' and the library should load 'tst_test.sh' or 'tst_net.sh'.
Quoted 13 lines
doc/library-api-writing-guidelines.txt +13
-0+ +Shell libraries should have conditional expansion for 'TST_SETUP' or 'TST_CLEANUP', +to avoid surprises when test specific setup/cleanup function is redefined by +shell library. + +[source,sh] +------------------------------------------------------------------------------- +# ipsec_lib.sh +# SPDX-License-Identifier: GPL-2.0-or-later +TST_SETUP=${TST_SETUP:-ipsec_lib_setup} +. tst_test.sh +... +-------------------------------------------------------------------------------
Signature · 10 lines
Martin Doucha [email protected] QA Engineer for Software Maintenance SUSE LINUX, s.r.o. CORSO IIa Krizikova 148/34 186 00 Prague 8 Czech Republic -- Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH v2 2/4] doc: Update library API doc
Hi Martin,
...
Quoted 4 lines
Quoted 4 lines
+3.1 Shell libraries
+~~~~~~~~~~~~~~~~~~~(quoted diff) +2
-0+ +Besides shell API libraries in 'testcases/lib' it's worth to put common code
Quoted 8 lines
doc/library-api-writing-guidelines.txt API source code is in 'tst_test.sh', 'tst_security.sh' and 'tst_net.sh' · line 70
Quoted 2 lines
doc/library-api-writing-guidelines.txt +2
-0+for particular tests into shell library. The filename should end '_lib.sh', +they should load 'tst_test.sh' or 'tst_net.sh'.Better wording:
Aside from shell API libraries in 'testcases/lib', it's worth putting common code for a group of tests into a shell library. The filename should end with '_lib.sh' and the library should load 'tst_test.sh' or 'tst_net.sh'.
+1, thank you!
I'll fix it before merge.
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH v2 3/4 tst_test.sh: Cleanup getopts usage
In reply to Petr Voreltst_test.sh used getopts twice, but the real parsing was on tst_run(). For tst_net.sh (or other libs) will be useful if there is only single parsing at the end of tst_test.sh, i.e. before entering tst_run().
This requires to move loading tst_test.sh to the end of the script (before calling tst_run()).
Changing loading tst_test.sh (or other shell libraries) in other shell libraries is not necessary (unless shell library defines a cleanup function), but move sourcing to the end of the file to follow the convention.
---
Changes v1->v2:
* Fix zram01.sh TST_SETUP redefinition
* Fix tst_net.sh for shell API test
* Fix dnsmasq_tests.sh (calling tst_selinux_enforced must be after loaded script)
* Style cleanup in if-lib.sh ipsec_lib.sh
lib/newlib_tests/shell/net/tst_ipaddr_un.sh | 2 +- lib/newlib_tests/shell/net/tst_rhost_run.sh | 2 +- lib/newlib_tests/shell/timeout01.sh | 2 +- lib/newlib_tests/shell/timeout02.sh | 2 +- lib/newlib_tests/shell/timeout03.sh | 2 +- lib/newlib_tests/shell/timeout04.sh | 2 +- lib/newlib_tests/shell/tst_check_driver.sh | 2 +- lib/newlib_tests/shell/tst_check_kconfig01.sh | 3 +- lib/newlib_tests/shell/tst_check_kconfig02.sh | 2 +- lib/newlib_tests/shell/tst_check_kconfig03.sh | 2 +- lib/newlib_tests/shell/tst_check_kconfig04.sh | 2 +- lib/newlib_tests/shell/tst_check_kconfig05.sh | 2 +- lib/newlib_tests/shell/tst_format_device.sh | 2 +- testcases/commands/ar/ar01.sh | 3 +- testcases/commands/cp/cp_tests.sh | 2 +- testcases/commands/cpio/cpio_tests.sh | 3 +- testcases/commands/df/df01.sh | 2 +- testcases/commands/du/du01.sh | 2 +- testcases/commands/eject/eject-tests.sh | 2 +- testcases/commands/file/file01.sh | 3 +- testcases/commands/gdb/gdb01.sh | 3 +- testcases/commands/gzip/gzip_tests.sh | 2 +- testcases/commands/insmod/insmod01.sh | 2 +- testcases/commands/keyctl/keyctl01.sh | 2 +- testcases/commands/ld/ld01.sh | 2 +- testcases/commands/ldd/ldd01.sh | 2 +- testcases/commands/ln/ln_tests.sh | 2 +- testcases/commands/lsmod/lsmod01.sh | 2 +- testcases/commands/mkdir/mkdir_tests.sh | 2 +- testcases/commands/mkfs/mkfs01.sh | 2 +- testcases/commands/mkswap/mkswap01.sh | 2 +- testcases/commands/mv/mv_tests.sh | 2 +- testcases/commands/nm/nm01.sh | 2 +- testcases/commands/shell/shell_pipe01.sh | 3 +- testcases/commands/sysctl/sysctl01.sh | 3 +- testcases/commands/sysctl/sysctl02.sh | 4 +- testcases/commands/tar/tar_tests.sh | 3 +- testcases/commands/unshare/unshare01.sh | 2 +- testcases/commands/unzip/unzip01.sh | 2 +- testcases/commands/vmcp/vmcp_m.sh | 3 +- testcases/commands/wc/wc01.sh | 2 +- testcases/commands/which/which01.sh | 2 +- testcases/kernel/connectors/pec/cn_pec.sh | 3 +- .../kernel/containers/netns/netns_breakns.sh | 11 ++-- .../kernel/containers/netns/netns_comm.sh | 11 ++-- .../kernel/containers/netns/netns_helper.sh | 3 +- .../kernel/containers/netns/netns_sysfs.sh | 3 +- .../cgroup/cgroup_regression_test.sh | 5 +- testcases/kernel/controllers/cgroup_lib.sh | 6 +- .../kernel/controllers/cpuacct/cpuacct.sh | 3 +- .../cpuset/cpuset_regression_test.sh | 4 +- .../memcg/functional/memcg_failcnt.sh | 2 +- .../memcg/functional/memcg_force_empty.sh | 2 +- .../controllers/memcg/functional/memcg_lib.sh | 60 +++++++++---------- .../memcg/functional/memcg_limit_in_bytes.sh | 2 +- .../memcg_max_usage_in_bytes_test.sh | 2 +- .../memcg_memsw_limit_in_bytes_test.sh | 2 +- .../memcg_move_charge_at_immigrate_test.sh | 2 +- .../memcg/functional/memcg_stat_rss.sh | 2 +- .../memcg/functional/memcg_stat_test.sh | 2 +- .../memcg/functional/memcg_subgroup_charge.sh | 2 +- .../functional/memcg_usage_in_bytes_test.sh | 2 +- .../functional/memcg_use_hierarchy_test.sh | 2 +- .../memcg/stress/memcg_stress_test.sh | 5 +- testcases/kernel/controllers/pids/pids.sh | 3 +- .../kernel/device-drivers/rcu/rcu_torture.sh | 3 +- .../kernel/device-drivers/zram/zram01.sh | 1 + .../kernel/device-drivers/zram/zram02.sh | 2 +- .../kernel/device-drivers/zram/zram_lib.sh | 3 +- .../kernel/fs/binfmt_misc/binfmt_misc01.sh | 2 +- .../kernel/fs/binfmt_misc/binfmt_misc02.sh | 2 +- .../kernel/fs/binfmt_misc/binfmt_misc_lib.sh | 4 +- testcases/kernel/fs/fs_bind/bind/fs_bind01.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind02.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind03.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind04.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind05.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind06.sh | 2 +- .../kernel/fs/fs_bind/bind/fs_bind07-2.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind07.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind08.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind09.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind10.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind11.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind12.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind13.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind14.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind15.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind16.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind17.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind18.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind19.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind20.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind21.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind22.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind23.sh | 2 +- testcases/kernel/fs/fs_bind/bind/fs_bind24.sh | 2 +- .../fs/fs_bind/cloneNS/fs_bind_cloneNS01.sh | 2 +- .../fs/fs_bind/cloneNS/fs_bind_cloneNS02.sh | 2 +- .../fs/fs_bind/cloneNS/fs_bind_cloneNS03.sh | 2 +- .../fs/fs_bind/cloneNS/fs_bind_cloneNS04.sh | 2 +- .../fs/fs_bind/cloneNS/fs_bind_cloneNS05.sh | 2 +- .../fs/fs_bind/cloneNS/fs_bind_cloneNS06.sh | 2 +- .../fs/fs_bind/cloneNS/fs_bind_cloneNS07.sh | 2 +- testcases/kernel/fs/fs_bind/fs_bind_lib.sh | 7 +-- .../kernel/fs/fs_bind/fs_bind_regression.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move01.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move02.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move03.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move04.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move05.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move06.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move07.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move08.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move09.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move10.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move11.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move12.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move13.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move14.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move15.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move16.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move17.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move18.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move19.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move20.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move21.sh | 2 +- .../kernel/fs/fs_bind/move/fs_bind_move22.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind01.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind02.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind03.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind04.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind05.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind06.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind07-2.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind07.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind08.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind09.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind10.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind11.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind12.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind13.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind14.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind15.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind16.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind17.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind18.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind19.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind20.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind21.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind22.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind23.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind24.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind25.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind26.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind27.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind28.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind29.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind30.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind31.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind32.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind33.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind34.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind35.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind36.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind37.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind38.sh | 2 +- .../fs/fs_bind/rbind/fs_bind_rbind39.sh | 2 +- testcases/kernel/fs/iso9660/isofs.sh | 3 +- testcases/kernel/fs/linktest/linktest.sh | 3 +- .../fs/quota_remount/quota_remount_test01.sh | 3 +- testcases/kernel/mem/vma/vma05.sh | 3 +- testcases/kernel/numa/numa01.sh | 3 +- .../integrity/ima/tests/evm_overlay.sh | 2 +- .../integrity/ima/tests/ima_conditionals.sh | 3 +- .../security/integrity/ima/tests/ima_kexec.sh | 3 +- .../security/integrity/ima/tests/ima_keys.sh | 4 +- .../integrity/ima/tests/ima_measurements.sh | 3 +- .../integrity/ima/tests/ima_policy.sh | 3 +- .../integrity/ima/tests/ima_selinux.sh | 3 +- .../security/integrity/ima/tests/ima_setup.sh | 4 +- .../security/integrity/ima/tests/ima_tpm.sh | 3 +- .../integrity/ima/tests/ima_violations.sh | 5 +- .../tracing/dynamic_debug/dynamic_debug01.sh | 5 +- testcases/lib/tst_net.sh | 5 +- testcases/lib/tst_test.sh | 29 ++++----- testcases/misc/lvm/cleanup_lvm.sh | 2 +- testcases/misc/lvm/generate_lvm_runfile.sh | 2 +- testcases/misc/lvm/prepare_lvm.sh | 2 +- testcases/network/busy_poll/busy_poll01.sh | 3 +- testcases/network/busy_poll/busy_poll02.sh | 3 +- testcases/network/busy_poll/busy_poll03.sh | 3 +- testcases/network/busy_poll/busy_poll_lib.sh | 5 +- testcases/network/dccp/dccp01.sh | 2 +- testcases/network/dhcp/dhcp_lib.sh | 6 +- testcases/network/dhcp/dhcpd_tests.sh | 6 +- testcases/network/dhcp/dnsmasq_tests.sh | 28 ++++----- testcases/network/iproute/ip_tests.sh | 2 +- testcases/network/iptables/iptables01.sh | 1 - testcases/network/iptables/iptables_lib.sh | 5 +- testcases/network/iptables/nft01.sh | 3 +- testcases/network/mpls/mpls01.sh | 2 +- testcases/network/mpls/mpls02.sh | 3 +- testcases/network/mpls/mpls03.sh | 5 +- testcases/network/mpls/mpls04.sh | 5 +- testcases/network/mpls/mpls_lib.sh | 4 +- .../network/multicast/mc_cmds/mc_cmds.sh | 6 +- .../network/multicast/mc_commo/mc_commo.sh | 5 +- .../network/multicast/mc_member/mc_member.sh | 6 +- testcases/network/nfs/fsx-linux/fsx.sh | 3 +- testcases/network/nfs/nfs_stress/nfs01.sh | 3 +- testcases/network/nfs/nfs_stress/nfs02.sh | 3 +- testcases/network/nfs/nfs_stress/nfs03.sh | 3 +- testcases/network/nfs/nfs_stress/nfs04.sh | 2 +- testcases/network/nfs/nfs_stress/nfs05.sh | 3 +- testcases/network/nfs/nfs_stress/nfs06.sh | 2 +- testcases/network/nfs/nfs_stress/nfs07.sh | 8 +-- testcases/network/nfs/nfs_stress/nfs_lib.sh | 3 +- testcases/network/nfs/nfslock01/nfslock01.sh | 3 +- testcases/network/nfs/nfsstat01/nfsstat01.sh | 3 +- .../network/rpc/basic_tests/rpc01/rpc01.sh | 2 +- testcases/network/rpc/basic_tests/rpc_lib.sh | 5 +- .../rpc/basic_tests/rpcinfo/rpcinfo01.sh | 2 +- .../network/rpc/basic_tests/rup/rup01.sh | 1 - .../rpc/basic_tests/rusers/rusers01.sh | 1 - testcases/network/rpc/rpc-tirpc/rpc_test.sh | 2 +- testcases/network/sctp/sctp01.sh | 2 +- testcases/network/sockets/bind_noport01.sh | 2 +- .../stress/broken_ip/broken_ip-checksum.sh | 2 +- .../stress/broken_ip/broken_ip-dstaddr.sh | 2 +- .../stress/broken_ip/broken_ip-fragment.sh | 2 +- .../network/stress/broken_ip/broken_ip-ihl.sh | 2 +- .../stress/broken_ip/broken_ip-nexthdr.sh | 10 ++-- .../stress/broken_ip/broken_ip-plen.sh | 2 +- .../stress/broken_ip/broken_ip-protcol.sh | 2 +- .../stress/broken_ip/broken_ip-version.sh | 2 +- testcases/network/stress/dccp/dccp_ipsec.sh | 4 +- .../network/stress/dccp/dccp_ipsec_vti.sh | 4 +- testcases/network/stress/dns/dns-stress.sh | 6 +- .../network/stress/ftp/ftp-download-stress.sh | 4 +- .../network/stress/ftp/ftp-upload-stress.sh | 4 +- testcases/network/stress/http/http-stress.sh | 4 +- .../network/stress/icmp/icmp-uni-basic.sh | 4 +- testcases/network/stress/icmp/icmp-uni-vti.sh | 4 +- .../stress/interface/if-addr-adddel.sh | 4 +- .../stress/interface/if-addr-addlarge.sh | 4 +- testcases/network/stress/interface/if-lib.sh | 5 +- .../network/stress/interface/if-mtu-change.sh | 4 +- .../stress/interface/if-route-adddel.sh | 4 +- .../stress/interface/if-route-addlarge.sh | 4 +- .../network/stress/interface/if-updown.sh | 4 +- .../stress/interface/if4-addr-change.sh | 2 +- testcases/network/stress/ipsec/ipsec_lib.sh | 13 ++-- .../mcast-group-multiple-socket.sh | 2 +- .../grp-operation/mcast-group-same-group.sh | 2 +- .../mcast-group-single-socket.sh | 2 +- .../mcast-group-source-filter.sh | 2 +- .../multicast/grp-operation/mcast-lib.sh | 6 +- .../multicast/packet-flood/mcast-pktfld01.sh | 2 +- .../multicast/packet-flood/mcast-pktfld02.sh | 2 +- .../multicast/query-flood/mcast-queryfld01.sh | 2 +- .../multicast/query-flood/mcast-queryfld02.sh | 2 +- .../multicast/query-flood/mcast-queryfld03.sh | 2 +- .../multicast/query-flood/mcast-queryfld04.sh | 2 +- .../multicast/query-flood/mcast-queryfld05.sh | 2 +- .../multicast/query-flood/mcast-queryfld06.sh | 2 +- .../network/stress/ns-tools/tst_net_stress.sh | 4 +- .../network/stress/route/route-change-dst.sh | 6 +- .../network/stress/route/route-change-gw.sh | 6 +- .../network/stress/route/route-change-if.sh | 6 +- .../stress/route/route-change-netlink-dst.sh | 4 +- .../stress/route/route-change-netlink-gw.sh | 4 +- .../stress/route/route-change-netlink-if.sh | 4 +- testcases/network/stress/route/route-lib.sh | 5 +- .../network/stress/route/route-redirect.sh | 4 +- testcases/network/stress/sctp/sctp_ipsec.sh | 4 +- .../network/stress/sctp/sctp_ipsec_vti.sh | 4 +- testcases/network/stress/ssh/ssh-stress.sh | 2 +- testcases/network/stress/tcp/tcp_ipsec.sh | 4 +- testcases/network/stress/tcp/tcp_ipsec_vti.sh | 4 +- testcases/network/stress/udp/udp_ipsec.sh | 4 +- testcases/network/stress/udp/udp_ipsec_vti.sh | 4 +- testcases/network/tcp_cc/bbr01.sh | 3 +- testcases/network/tcp_cc/bbr02.sh | 4 +- testcases/network/tcp_cc/dctcp01.sh | 3 +- testcases/network/tcp_cc/tcp_cc_lib.sh | 5 +- testcases/network/tcp_cmds/arping/arping01.sh | 2 +- .../network/tcp_cmds/clockdiff/clockdiff01.sh | 2 +- testcases/network/tcp_cmds/host/host01.sh | 2 +- .../network/tcp_cmds/ipneigh/ipneigh01.sh | 2 +- .../network/tcp_cmds/netstat/netstat01.sh | 2 +- testcases/network/tcp_cmds/ping/ping01.sh | 2 +- testcases/network/tcp_cmds/ping/ping02.sh | 2 +- .../network/tcp_cmds/sendfile/sendfile01.sh | 2 +- testcases/network/tcp_cmds/tc/tc01.sh | 3 +- .../network/tcp_cmds/tcpdump/tcpdump01.sh | 3 +- testcases/network/tcp_cmds/telnet/telnet01.sh | 3 +- .../network/tcp_cmds/tracepath/tracepath01.sh | 2 +- .../network/tcp_fastopen/tcp_fastopen_run.sh | 2 +- testcases/network/traceroute/traceroute01.sh | 2 +- testcases/network/virt/fou01.sh | 2 +- testcases/network/virt/geneve01.sh | 9 ++- testcases/network/virt/geneve02.sh | 14 ++--- testcases/network/virt/gre01.sh | 2 +- testcases/network/virt/gre02.sh | 2 +- testcases/network/virt/ipvlan01.sh | 2 +- testcases/network/virt/macsec01.sh | 1 - testcases/network/virt/macsec02.sh | 1 - testcases/network/virt/macsec03.sh | 3 +- testcases/network/virt/macsec_lib.sh | 5 +- testcases/network/virt/macvlan01.sh | 2 +- testcases/network/virt/macvtap01.sh | 2 +- testcases/network/virt/sit01.sh | 2 +- testcases/network/virt/virt_lib.sh | 34 +++++------ testcases/network/virt/vlan01.sh | 2 +- testcases/network/virt/vlan02.sh | 2 +- testcases/network/virt/vlan03.sh | 2 +- testcases/network/virt/vxlan01.sh | 9 ++- testcases/network/virt/vxlan02.sh | 5 +- testcases/network/virt/vxlan03.sh | 2 +- testcases/network/virt/vxlan04.sh | 2 +- testcases/network/virt/wireguard01.sh | 3 +- testcases/network/virt/wireguard02.sh | 6 +- testcases/network/virt/wireguard_lib.sh | 3 +- testcases/network/xinetd/xinetd_tests.sh | 2 +- 325 files changed, 496 insertions(+), 567 deletions(-)
lib/newlib_tests/shell/net/tst_ipaddr_un.sh +1 -1
@@ -13,7 +13,6 @@ TST_NET_SKIP_VARIABLE_INIT=1 IPV4_NET16_UNUSED="10.23" IPV6_NET32_UNUSED="fd00:23" -. tst_net.sh IPV4_DATA=" 0 0|10.23.0.0
@@ -168,4 +167,5 @@ do_test() esac } +. tst_net.sh tst_run
lib/newlib_tests/shell/net/tst_rhost_run.sh +1 -1
@@ -4,7 +4,6 @@ TST_TESTFUNC=do_test PATH="$(dirname $0)/../../../../testcases/lib/:$PATH" -. tst_net.sh export TST_NET_RHOST_RUN_DEBUG=1
@@ -24,4 +23,5 @@ do_test() tst_res TPASS "tst_rhost_run is working" } +. tst_net.sh tst_run
lib/newlib_tests/shell/timeout01.sh +1 -1
@@ -5,11 +5,11 @@ TST_TESTFUNC=do_test TST_TIMEOUT=-1 -. tst_test.sh do_test() { tst_res TPASS "timeout $TST_TIMEOUT set" } +. tst_test.sh tst_run
lib/newlib_tests/shell/timeout02.sh +1 -1
@@ -5,11 +5,11 @@ TST_TESTFUNC=do_test TST_TIMEOUT=2 -. tst_test.sh do_test() { tst_res TPASS "timeout $TST_TIMEOUT set (LTP_TIMEOUT_MUL='$LTP_TIMEOUT_MUL')" } +. tst_test.sh tst_run
lib/newlib_tests/shell/timeout03.sh +1 -1
@@ -28,7 +28,6 @@ TST_TESTFUNC=do_test TST_CLEANUP=cleanup TST_TIMEOUT=1 -. tst_test.sh do_test() {
@@ -46,4 +45,5 @@ cleanup() tst_res TFAIL "cleanup: running after TST_TIMEOUT" } +. tst_test.sh tst_run
lib/newlib_tests/shell/timeout04.sh +1 -1
@@ -5,7 +5,6 @@ TST_TESTFUNC=do_test TST_TIMEOUT=1 -. tst_test.sh do_test() {
@@ -19,4 +18,5 @@ do_cleanup() tst_res TINFO "cleanup" } +. tst_test.sh tst_run
lib/newlib_tests/shell/tst_check_driver.sh +1 -1
@@ -6,7 +6,6 @@ TST_TESTFUNC=test TST_SETUP=setup TST_CNT=3 TST_NEEDS_CMDS="tst_check_drivers find grep head sed" -. tst_test.sh MODULES_DIR="${MODULES_DIR:-/lib/modules/$(uname -r)}"
@@ -60,4 +59,5 @@ test3() test_drivers $(grep -E '_[^/]+\.ko' $f | head -3) } +. tst_test.sh tst_run
lib/newlib_tests/shell/tst_check_kconfig01.sh +1 -2
@@ -5,11 +5,10 @@ TST_TESTFUNC=do_test TST_NEEDS_KCONFIGS="CONFIG_EXT4" -. tst_test.sh - do_test() { tst_res TFAIL "kernel .config doesn't have CONFIG_EXT4" } +. tst_test.sh tst_run
lib/newlib_tests/shell/tst_check_kconfig02.sh +1 -1
@@ -4,11 +4,11 @@ TST_TESTFUNC=do_test TST_NEEDS_KCONFIGS="CONFIG_EXT4_FS : CONFIG_XFS_FS" -. tst_test.sh do_test() { tst_res TFAIL "invalid kconfig delimter" } +. tst_test.sh tst_run
lib/newlib_tests/shell/tst_check_kconfig03.sh +1 -1
@@ -5,11 +5,11 @@ TST_TESTFUNC=do_test TST_NEEDS_KCONFIGS="CONFIG_EXT4_FS : CONFIG_XFS_FS" TST_NEEDS_KCONFIGS_IFS=":" -. tst_test.sh do_test() { tst_res TPASS "valid kconfig delimter" } +. tst_test.sh tst_run
lib/newlib_tests/shell/tst_check_kconfig04.sh +1 -1
@@ -3,7 +3,6 @@ # Copyright (c) 2022 FUJITSU LIMITED. All rights reserved. TST_TESTFUNC=do_test -. tst_test.sh do_test() {
@@ -21,4 +20,5 @@ do_test() tst_res TPASS "kernel .config doesn't have CONFIG_EXT4" fi } +. tst_test.sh tst_run
lib/newlib_tests/shell/tst_check_kconfig05.sh +1 -1
@@ -3,7 +3,6 @@ # Copyright (c) 2022 FUJITSU LIMITED. All rights reserved. TST_TESTFUNC=do_test -. tst_test.sh do_test() {
@@ -13,4 +12,5 @@ do_test() tst_require_kconfigs "CONFIG_EXT4" tst_res TFAIL "kernel .config has CONFIG_EXT4" } +. tst_test.sh tst_run
lib/newlib_tests/shell/tst_format_device.sh +1 -1
@@ -7,7 +7,6 @@ TST_TESTFUNC=test TST_CNT=2 TST_DEV_FS_OPTS="-b 1024 -O quota" TST_DEV_EXTRA_OPTS="5m" -. tst_test.sh test1() {
@@ -20,4 +19,5 @@ test2() EXPECT_PASS "df $TST_DEVICE | grep -q /dev" } +. tst_test.sh tst_run
testcases/commands/ar/ar01.sh +1 -2
@@ -13,8 +13,6 @@ TST_TESTFUNC=test TST_NEEDS_TMPDIR=1 TST_NEEDS_CMDS="$AR" -. tst_test.sh - setup() { MOD=
@@ -348,4 +346,5 @@ test17() ROD rm -f lib.a file2.in } +. tst_test.sh tst_run
testcases/commands/cp/cp_tests.sh +1 -1
@@ -10,7 +10,6 @@ TST_CNT=5 TST_TESTFUNC=do_test TST_SETUP=setup TST_NEEDS_TMPDIR=1 -. tst_test.sh create_tree() {
@@ -91,4 +90,5 @@ do_test() esac } +. tst_test.sh tst_run
testcases/commands/cpio/cpio_tests.sh +1 -2
@@ -8,8 +8,6 @@ TST_TESTFUNC=cpio_test TST_NEEDS_TMPDIR=1 TST_NEEDS_CMDS="cpio" TST_SETUP="setup" -. tst_test.sh - setup() {
@@ -47,4 +45,5 @@ cpio_test() fi } +. tst_test.sh tst_run
testcases/commands/df/df01.sh +1 -1
@@ -14,7 +14,6 @@ TST_USAGE=usage TST_PARSE_ARGS=parse_args TST_NEEDS_ROOT=1 TST_FORMAT_DEVICE=1 -. tst_test.sh usage() {
@@ -192,4 +191,5 @@ test12() fi } +. tst_test.sh tst_run
testcases/commands/du/du01.sh +1 -1
@@ -10,7 +10,6 @@ TST_SETUP=setup TST_TESTFUNC=do_test TST_NEEDS_TMPDIR=1 TST_NEEDS_CMDS="dd du stat" -. tst_test.sh setup() {
@@ -108,4 +107,5 @@ do_test() esac } +. tst_test.sh tst_run
testcases/commands/eject/eject-tests.sh +1 -1
@@ -13,7 +13,6 @@ TST_TESTFUNC=test TST_NEEDS_TMPDIR=1 TST_NEEDS_ROOT=1 TST_NEEDS_CMDS="eject" -. tst_test.sh setup() {
@@ -144,4 +143,5 @@ test4() fi } +. tst_test.sh tst_run
testcases/commands/file/file01.sh +1 -2
@@ -13,8 +13,6 @@ TST_TESTFUNC=do_test TST_NEEDS_TMPDIR=1 TST_NEEDS_CMDS="readelf" -. tst_test.sh - setup() { case $(readelf -h /bin/sh) in
@@ -90,4 +88,5 @@ do_test() esac } +. tst_test.sh tst_run
testcases/commands/gdb/gdb01.sh +1 -2
@@ -8,8 +8,6 @@ TST_TESTFUNC=simple_test TST_NEEDS_CMDS="gdb /bin/cat" -. tst_test.sh - simple_test() { gdb /bin/cat -ex "run /etc/passwd" -ex quit < /dev/null
@@ -21,4 +19,5 @@ simple_test() fi } +. tst_test.sh tst_run
testcases/commands/gzip/gzip_tests.sh +1 -1
@@ -14,7 +14,6 @@ TST_CNT=2 TST_TESTFUNC=test TST_NEEDS_TMPDIR=1 TST_NEEDS_CMDS="gzip gunzip" -. tst_test.sh creat_dirnfiles() {
@@ -149,4 +148,5 @@ test2() ROD_SILENT rm -rf tst_gzip.tmp/ } +. tst_test.sh tst_run
testcases/commands/insmod/insmod01.sh +1 -1
@@ -10,7 +10,6 @@ TST_TESTFUNC=do_test TST_NEEDS_ROOT=1 TST_NEEDS_CMDS="rmmod insmod" TST_NEEDS_MODULE="ltp_insmod01.ko" -. tst_test.sh inserted=0
@@ -46,4 +45,5 @@ do_test() tst_res TPASS "insmod passed" } +. tst_test.sh tst_run
testcases/commands/keyctl/keyctl01.sh +1 -1
@@ -18,7 +18,6 @@ TST_TESTFUNC=do_test TST_NEEDS_ROOT=1 TST_NEEDS_TMPDIR=1 TST_NEEDS_CMDS="keyctl" -. tst_test.sh check_keyctl() {
@@ -109,4 +108,5 @@ do_test() tst_res TPASS "Bug not reproduced" } +. tst_test.sh tst_run
testcases/commands/ld/ld01.sh +1 -1
@@ -14,7 +14,6 @@ TST_TESTFUNC=test TST_SETUP=setup TST_NEEDS_TMPDIR=1 TST_NEEDS_CMDS="$CC $LD" -. tst_test.sh setup() {
@@ -78,4 +77,5 @@ test5() fi } +. tst_test.sh tst_run
testcases/commands/ldd/ldd01.sh +1 -1
@@ -8,7 +8,6 @@ TST_CNT=2 TST_SETUP=setup TST_TESTFUNC=test -. tst_test.sh LDD=${LDD:=ldd}
@@ -39,4 +38,5 @@ test2() fi } +. tst_test.sh tst_run
testcases/commands/ln/ln_tests.sh +1 -1
@@ -10,7 +10,6 @@ TST_CNT=6 TST_TESTFUNC=do_test TST_SETUP=setup TST_NEEDS_TMPDIR=1 -. tst_test.sh setup() {
@@ -78,4 +77,5 @@ do_test() esac } +. tst_test.sh tst_run
testcases/commands/lsmod/lsmod01.sh +1 -1
@@ -11,7 +11,6 @@ TST_SETUP=setup TST_TESTFUNC=lsmod_test TST_NEEDS_TMPDIR=1 TST_NEEDS_CMDS="lsmod" -. tst_test.sh module_inserted=
@@ -82,4 +81,5 @@ lsmod_test() tst_res TFAIL "'lsmod' doesn't match /proc/modules output" } +. tst_test.sh tst_run
testcases/commands/mkdir/mkdir_tests.sh +1 -1
@@ -9,7 +9,6 @@ TST_CNT=3 TST_SETUP=setup TST_TESTFUNC=test TST_NEEDS_TMPDIR=1 -. tst_test.sh setup() {
@@ -50,4 +49,5 @@ test3() ROD rm -rf "$LONG_PATH" } +. tst_test.sh tst_run
testcases/commands/mkfs/mkfs01.sh +1 -1
@@ -14,7 +14,6 @@ TST_PARSE_ARGS=parse_args TST_NEEDS_ROOT=1 TST_NEEDS_DEVICE=1 TST_NEEDS_CMDS="blkid df" -. tst_test.sh usage() {
@@ -174,4 +173,5 @@ test5() mkfs_test "-h" } +. tst_test.sh tst_run
testcases/commands/mkswap/mkswap01.sh +1 -1
@@ -11,7 +11,6 @@ TST_TESTFUNC=do_test TST_NEEDS_ROOT=1 TST_NEEDS_DEVICE=1 TST_NEEDS_CMDS="uuidgen blkid blockdev mkswap" -. tst_test.sh setup() {
@@ -157,4 +156,5 @@ do_test() esac } +. tst_test.sh tst_run
testcases/commands/mv/mv_tests.sh +1 -1
@@ -13,7 +13,6 @@ TST_CNT=2 TST_SETUP=setup TST_TESTFUNC=test TST_NEEDS_TMPDIR=1 -. tst_test.sh setup() {
@@ -149,4 +148,5 @@ test2() fi } +. tst_test.sh tst_run
testcases/commands/nm/nm01.sh +1 -1
@@ -13,7 +13,6 @@ TST_TESTFUNC=test TST_SETUP=setup TST_NEEDS_TMPDIR=1 TST_NEEDS_CMDS="$NM" -. tst_test.sh setup() {
@@ -121,4 +120,5 @@ test7() fi } +. tst_test.sh tst_run
testcases/commands/shell/shell_pipe01.sh +1 -2
@@ -4,8 +4,6 @@ TST_TESTFUNC=do_test -. tst_test.sh - do_test() { tst_res TINFO "expecting SUCCESS string passed from stdin"
@@ -14,4 +12,5 @@ do_test() EXPECT_PASS [ "$line" = "SUCCESS" ] } +. tst_test.sh tst_run
testcases/commands/sysctl/sysctl01.sh +1 -2
@@ -13,8 +13,6 @@ TST_TESTFUNC=sysctl_test TST_NEEDS_ROOT=1 TST_NEEDS_CMDS="sysctl" -. tst_test.sh - sysctl_test() { # With commit d00535d, sched_time_avg was renamed as sched_time_avg_ms
@@ -38,4 +36,5 @@ sysctl_test() fi } +. tst_test.sh tst_run
testcases/commands/sysctl/sysctl02.sh +2 -2
@@ -21,11 +21,10 @@ TST_CNT=4 TST_NEEDS_ROOT=1 TST_NEEDS_CMDS="sysctl" TST_NEEDS_KCONFIGS="CONFIG_SYSCTL=y, CONFIG_PROC_FS=y" + sys_name="fs.file-max" sys_file="/proc/sys/fs/file-max" -. tst_test.sh - setup() { orig_value=$(cat "$sys_file")
@@ -77,4 +76,5 @@ cleanup() [ -n "$orig_value" ] && sysctl -w -q $sys_name=$orig_value } +. tst_test.sh tst_run
testcases/commands/tar/tar_tests.sh +1 -2
@@ -11,8 +11,6 @@ TST_TESTFUNC=do_test TST_NEEDS_TMPDIR=1 TST_NEEDS_CMDS="gzip bzip2" -. tst_test.sh - TAR_FILES="file1 file2 file3" check_listing()
@@ -133,4 +131,5 @@ do_test() esac } +. tst_test.sh tst_run
testcases/commands/unshare/unshare01.sh +1 -1
@@ -33,7 +33,6 @@ TST_TESTFUNC=do_test TST_NEEDS_ROOT=1 TST_NEEDS_TMPDIR=1 TST_NEEDS_CMDS="unshare id mount umount" -. tst_test.sh max_userns_path="/proc/sys/user/max_user_namespaces" max_mntns_path="/proc/sys/user/max_mnt_namespaces"
@@ -157,4 +156,5 @@ do_test() esac } +. tst_test.sh tst_run
testcases/commands/unzip/unzip01.sh +1 -1
@@ -10,7 +10,6 @@ TST_SETUP=setup TST_TESTFUNC=do_test TST_NEEDS_TMPDIR=1 TST_NEEDS_CMDS="unzip" -. tst_test.sh EXTRACT_MATCH="extracting"
@@ -83,4 +82,5 @@ do_test() ROD rm -rf "dir/" } +. tst_test.sh tst_run
testcases/commands/vmcp/vmcp_m.sh +1 -2
@@ -14,7 +14,6 @@ TST_CNT=2 TST_TESTFUNC=vmcp_main TST_NEEDS_CMDS="vmcp" -. tst_test.sh vmcp_run() {
@@ -45,5 +44,5 @@ vmcp_main2() vmcp_run 1 "vmcp dasddasddasd" } - +. tst_test.sh tst_run
testcases/commands/wc/wc01.sh +1 -1
@@ -10,7 +10,6 @@ TST_SETUP=setup TST_TESTFUNC=do_test TST_NEEDS_TMPDIR=1 TST_NEEDS_CMDS="wc" -. tst_test.sh setup() {
@@ -67,4 +66,5 @@ do_test() esac } +. tst_test.sh tst_run
testcases/commands/which/which01.sh +1 -1
@@ -10,7 +10,6 @@ TST_SETUP=setup TST_TESTFUNC=do_test TST_NEEDS_TMPDIR=1 TST_NEEDS_CMDS="which" -. tst_test.sh setup() {
@@ -104,4 +103,5 @@ do_test() esac } +. tst_test.sh tst_run
testcases/kernel/connectors/pec/cn_pec.sh +1 -2
@@ -19,8 +19,6 @@ TST_NEEDS_TMPDIR=1 TST_NEEDS_CHECKPOINTS=1 TST_TEST_DATA="fork exec exit uid gid" -. tst_test.sh - num_events=10 LISTENER_ID=0
@@ -146,4 +144,5 @@ test() fi } +. tst_test.sh tst_run
testcases/kernel/containers/netns/netns_breakns.sh +6 -5
@@ -29,11 +29,6 @@ TST_POS_ARGS=3 TST_SETUP=do_setup TST_TESTFUNC=do_test -. netns_helper.sh - -PROG=$1 -IP_VER=$2 -COM_TYPE=$3 do_setup() {
@@ -49,4 +44,10 @@ do_test() EXPECT_FAIL $NS_EXEC $NS_HANDLE0 $NS_TYPE ifconfig veth1 $IFCONF_IN6_ARG $IP1/$NETMASK } +. netns_helper.sh + +PROG=$1 +IP_VER=$2 +COM_TYPE=$3 + tst_run
testcases/kernel/containers/netns/netns_comm.sh +6 -5
@@ -32,11 +32,6 @@ TST_POS_ARGS=3 TST_SETUP=do_setup TST_TESTFUNC=do_test -. netns_helper.sh - -PROG=$1 -IP_VER=$2 -COM_TYPE=$3 do_setup() {
@@ -67,4 +62,10 @@ do_test() EXPECT_PASS $NS_EXEC $NS_HANDLE0 $NS_TYPE $tping -q -c2 -I lo $ip_lo 1>/dev/null } +. netns_helper.sh + +PROG=$1 +IP_VER=$2 +COM_TYPE=$3 + tst_run
testcases/kernel/containers/netns/netns_helper.sh +2 -1
@@ -7,7 +7,6 @@ TST_CLEANUP=netns_ns_exec_cleanup TST_NEEDS_ROOT=1 TST_NEEDS_CMDS="ip ping" TST_NEEDS_DRIVERS="veth" -. tst_test.sh # Set to 1 only for test cases using ifconfig (ioctl). USE_IFCONFIG=0
@@ -276,3 +275,5 @@ netns_ip_cleanup() ip netns del $NS_HANDLE0 2>/dev/null ip netns del $NS_HANDLE1 2>/dev/null } + +. tst_test.sh
testcases/kernel/containers/netns/netns_sysfs.sh +1 -2
@@ -11,7 +11,6 @@ TST_CLEANUP=do_cleanup TST_SETUP=do_setup TST_TESTFUNC=do_test TST_NEEDS_TMPDIR=1 -. tst_test.sh do_setup() {
@@ -50,7 +49,6 @@ do_cleanup() kill -9 $NS_HANDLE 2>/dev/null } - do_test() { EXPECT_PASS ns_exec $NS_HANDLE $NS_TYPE test -e /sys/class/net/$DUMMYDEV
@@ -58,4 +56,5 @@ do_test() EXPECT_FAIL test -e /sys/class/net/$DUMMYDEV } +. tst_test.sh tst_run
testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +2 -3
@@ -1,6 +1,6 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later -# Copyright (c) 2019 Petr Vorel <[email protected]> +# Copyright (c) 2019-2022 Petr Vorel <[email protected]> # Copyright (c) 2009 FUJITSU LIMITED # Author: Li Zefan <[email protected]>
@@ -12,8 +12,6 @@ TST_NEEDS_ROOT=1 TST_NEEDS_TMPDIR=1 TST_NEEDS_CMDS="awk dmesg find mountpoint rmdir" -. cgroup_lib.sh - do_setup() { mkdir cgroup/
@@ -439,4 +437,5 @@ test9() check_kernel_bug } +. cgroup_lib.sh tst_run
testcases/kernel/controllers/cgroup_lib.sh +3 -3
@@ -1,10 +1,8 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later -# Copyright (c) 2019 Petr Vorel <[email protected]> +# Copyright (c) 2019-2022 Petr Vorel <[email protected]> # Copyright (c) 2018-2019 ARM Ltd. All Rights Reserved. -. tst_test.sh - # Find mountpoint to given subsystem # get_cgroup_mountpoint SUBSYSTEM # RETURN: 0 if mountpoint found, otherwise 1
@@ -37,3 +35,5 @@ is_cgroup_subsystem_available_and_enabled() return 1 } + +. tst_test.sh
testcases/kernel/controllers/cpuacct/cpuacct.sh +1 -2
@@ -21,8 +21,6 @@ TST_NEEDS_ROOT=1 TST_NEEDS_TMPDIR=1 TST_NEEDS_CMDS="awk" -. tst_test.sh - mounted=1 max=$1 nbprocess=$2
@@ -178,4 +176,5 @@ do_test() fi } +. tst_test.sh tst_run
testcases/kernel/controllers/cpuset/cpuset_regression_test.sh +2 -2
@@ -1,5 +1,6 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) Linux Test Project, 2016-2022 # Copyright (c) 2015 Fujitsu Ltd. # Author: Zeng Linggang <[email protected]> #
@@ -16,8 +17,6 @@ TST_NEEDS_ROOT=1 TST_NEEDS_TMPDIR=1 TST_MIN_KVER="3.18" -. cgroup_lib.sh - LOCAL_MOUNTPOINT="cpuset_test" BACKUP_DIRECTORY="cpuset_backup"
@@ -218,4 +217,5 @@ test() tst_res TPASS "Bug is not reproducible" } +. cgroup_lib.sh tst_run
testcases/kernel/controllers/memcg/functional/memcg_failcnt.sh +1 -1
@@ -11,7 +11,6 @@ MEMCG_TESTFUNC=test MEMCG_SHMMAX=1 TST_TEST_DATA="--mmap-anon --mmap-file --shm" -. memcg_lib.sh MEMORY_LIMIT=$PAGESIZE MEMORY_TO_ALLOCATE=$((MEMORY_LIMIT * 2))
@@ -36,4 +35,5 @@ test() fi } +. memcg_lib.sh tst_run
testcases/kernel/controllers/memcg/functional/memcg_force_empty.sh +1 -1
@@ -11,7 +11,6 @@ MEMCG_TESTFUNC=test TST_CNT=6 -. memcg_lib.sh # Test memory.force_empty test1()
@@ -54,4 +53,5 @@ test6() EXPECT_FAIL echo 1 \> /dev/memcg/memory.force_empty } +. memcg_lib.sh tst_run
testcases/kernel/controllers/memcg/functional/memcg_lib.sh +30 -30
75 lines not on this page · raw message
testcases/kernel/controllers/memcg/functional/memcg_limit_in_bytes.sh +1 -1
@@ -12,7 +12,6 @@ MEMCG_TESTFUNC=test MEMCG_SHMMAX=1 TST_CNT=15 -. memcg_lib.sh TST_CLEANUP=cleanup cleanup()
@@ -111,4 +110,5 @@ test15() EXPECT_FAIL echo xx \> memory.limit_in_bytes } +. memcg_lib.sh tst_run
testcases/kernel/controllers/memcg/functional/memcg_max_usage_in_bytes_test.sh +1 -1
@@ -9,7 +9,6 @@ MEMCG_TESTFUNC=test TST_CNT=4 -. memcg_lib.sh MEM_TO_ALLOC=$((PAGESIZE * 1024)) MEM_EXPECTED_UPPER=$((MEM_TO_ALLOC + MEM_USAGE_RANGE))
@@ -88,4 +87,5 @@ test4() test_max_usage_in_bytes 1 1 } +. memcg_lib.sh tst_run
testcases/kernel/controllers/memcg/functional/memcg_memsw_limit_in_bytes_test.sh +1 -1
@@ -9,7 +9,6 @@ MEMCG_TESTFUNC=test TST_CNT=12 -. memcg_lib.sh test1() {
@@ -88,4 +87,5 @@ test12() EXPECT_FAIL echo xx \> memory.memsw.limit_in_bytes } +. memcg_lib.sh tst_run
testcases/kernel/controllers/memcg/functional/memcg_move_charge_at_immigrate_test.sh +1 -1
@@ -9,7 +9,6 @@ MEMCG_TESTFUNC=test TST_CNT=4 -. memcg_lib.sh # Run test cases which test memory.move_charge_at_immigrate
@@ -80,4 +79,5 @@ test4() $((PAGESIZES * 2)) 3 $PAGESIZES $PAGESIZES 0 0 } +. memcg_lib.sh tst_run
testcases/kernel/controllers/memcg/functional/memcg_stat_rss.sh +1 -1
@@ -13,7 +13,6 @@ MEMCG_TESTFUNC=test MEMCG_SHMMAX=1 TST_CNT=10 -. memcg_lib.sh # Test the management and counting of memory test1()
@@ -68,4 +67,5 @@ test10() test_mem_stat "--mmap-lock1" $PAGESIZES $PAGESIZES "rss" $PAGESIZES $PAGESIZES true } +. memcg_lib.sh tst_run
testcases/kernel/controllers/memcg/functional/memcg_stat_test.sh +1 -1
@@ -9,7 +9,6 @@ MEMCG_TESTFUNC=test TST_CNT=8 -. memcg_lib.sh test1() {
@@ -115,4 +114,5 @@ test8() rmdir subgroup } +. memcg_lib.sh tst_run
testcases/kernel/controllers/memcg/functional/memcg_subgroup_charge.sh +1 -1
@@ -12,7 +12,6 @@ MEMCG_TESTFUNC=test TST_CNT=3 -. memcg_lib.sh # Allocate memory bigger than per-cpu kernel memory MEM_TO_ALLOC=$((PAGESIZES * 2))
@@ -67,4 +66,5 @@ test3() test_subgroup 0 } +. memcg_lib.sh tst_run
testcases/kernel/controllers/memcg/functional/memcg_usage_in_bytes_test.sh +1 -1
@@ -9,7 +9,6 @@ MEMCG_TESTFUNC=test TST_CNT=2 -. memcg_lib.sh MEM_TO_ALLOC=$((PAGESIZE * 1024)) MEM_EXPECTED_UPPER=$((MEM_TO_ALLOC + MEM_USAGE_RANGE))
@@ -35,4 +34,5 @@ test2() $MEM_EXPECTED_UPPER false } +. memcg_lib.sh tst_run
testcases/kernel/controllers/memcg/functional/memcg_use_hierarchy_test.sh +1 -1
@@ -9,7 +9,6 @@ MEMCG_TESTFUNC=test TST_CNT=3 -. memcg_lib.sh test1() {
@@ -53,4 +52,5 @@ test3() rmdir subgroup } +. memcg_lib.sh tst_run
testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh +2 -3
@@ -2,7 +2,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later # Copyright (c) 2009 FUJITSU LIMITED # Copyright (c) 2018-2019 ARM Ltd. All Rights Reserved. -# Copyright (c) 2019 Petr Vorel <[email protected]> +# Copyright (c) 2019-2022 Petr Vorel <[email protected]> # # Author: Li Zefan <[email protected]> # Restructure for LTP: Shi Weihua <[email protected]>
@@ -19,8 +19,6 @@ TST_NEEDS_CMDS="mount umount cat kill mkdir rmdir grep awk cut" # therefore the default 5 mins timeout is not enough. TST_TIMEOUT=2100 -. cgroup_lib.sh - setup() { if ! is_cgroup_subsystem_available_and_enabled "memory"; then
@@ -111,4 +109,5 @@ test2() run_stress 1 $(( $MEM - $THREAD_SPARE_MB)) 5 $RUN_TIME } +. cgroup_lib.sh tst_run
testcases/kernel/controllers/pids/pids.sh +1 -2
@@ -13,8 +13,6 @@ TST_USAGE=usage TST_NEEDS_ROOT=1 TST_NEEDS_CMDS="killall" -. tst_test.sh - caseno=$1 max=$2 subcgroup_num=$3
@@ -393,4 +391,5 @@ do_test() case$caseno } +. tst_test.sh tst_run
testcases/kernel/device-drivers/rcu/rcu_torture.sh +1 -2
@@ -19,8 +19,6 @@ TST_OPTS="t:w:" TST_USAGE=rcutorture_usage TST_PARSE_ARGS=rcutorture_parse_args -. tst_test.sh - # default options test_time=30 num_writers=5
@@ -92,4 +90,5 @@ do_test() esac } +. tst_test.sh tst_run
testcases/kernel/device-drivers/zram/zram01.sh +1 -0
@@ -151,4 +151,5 @@ do_test() esac } +. zram_lib.sh tst_run
testcases/kernel/device-drivers/zram/zram02.sh +1 -1
@@ -7,7 +7,6 @@ TST_CNT=6 TST_TESTFUNC="do_test" -. zram_lib.sh # List of parameters for zram devices. # For each number the test creates own zram device.
@@ -64,4 +63,5 @@ do_test() esac } +. zram_lib.sh tst_run
testcases/kernel/device-drivers/zram/zram_lib.sh +2 -1
@@ -15,7 +15,6 @@ TST_NEEDS_ROOT=1 TST_SETUP="${TST_SETUP:-zram_load}" TST_CLEANUP="${TST_CLEANUP:-zram_cleanup}" TST_NEEDS_DRIVERS="zram" -. tst_test.sh zram_cleanup() {
@@ -193,3 +192,5 @@ zram_set_memlimit() tst_res TPASS "test succeeded" } + +. tst_test.sh
testcases/kernel/fs/binfmt_misc/binfmt_misc01.sh +1 -1
@@ -25,7 +25,6 @@ TST_CNT=9 TST_TESTFUNC=do_test TST_NEEDS_CMDS="cat" -. binfmt_misc_lib.sh verify_binfmt_misc() {
@@ -61,4 +60,5 @@ do_test() esac } +. binfmt_misc_lib.sh tst_run
testcases/kernel/fs/binfmt_misc/binfmt_misc02.sh +1 -1
@@ -21,7 +21,6 @@ TST_CNT=6 TST_TESTFUNC=do_test TST_NEEDS_CMDS="cat head" -. binfmt_misc_lib.sh recognised_unrecognised() {
@@ -106,4 +105,5 @@ do_test() esac } +. binfmt_misc_lib.sh tst_run
testcases/kernel/fs/binfmt_misc/binfmt_misc_lib.sh +2 -2
@@ -11,8 +11,6 @@ TST_NEEDS_TMPDIR=1 TST_NEEDS_ROOT=1 TST_NEEDS_CMDS="${TST_NEEDS_CMDS} modprobe mount umount mkdir rm" -. tst_test.sh - rmod_binfmt_misc=0 umount_binfmt_misc=0 binfmt_misc_mntpoint="ltp_binfmt_misc"
@@ -72,3 +70,5 @@ binfmt_misc_cleanup() rmod_binfmt_misc=0 fi } + +. tst_test.sh
testcases/kernel/fs/fs_bind/bind/fs_bind01.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -45,4 +44,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/bind/fs_bind02.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -46,4 +45,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/bind/fs_bind03.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -57,4 +56,5 @@ test() EXPECT_PASS umount parent2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/bind/fs_bind04.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -46,4 +45,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/bind/fs_bind05.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -54,4 +53,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/bind/fs_bind06.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -44,4 +43,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/bind/fs_bind07-2.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -31,4 +30,5 @@ test() EXPECT_PASS umount share2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/bind/fs_bind07.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -54,4 +53,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/bind/fs_bind08.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -45,4 +44,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/bind/fs_bind09.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -54,4 +53,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/bind/fs_bind10.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -49,4 +48,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/bind/fs_bind11.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -60,4 +59,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/bind/fs_bind12.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -49,4 +48,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/bind/fs_bind13.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -35,4 +34,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/bind/fs_bind14.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -31,4 +30,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/bind/fs_bind15.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -40,4 +39,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/bind/fs_bind16.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -32,4 +31,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/bind/fs_bind17.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -45,4 +44,5 @@ test() EXPECT_PASS umount share1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/bind/fs_bind18.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -45,4 +44,5 @@ test() EXPECT_PASS umount share1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/bind/fs_bind19.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -49,4 +48,5 @@ test() EXPECT_PASS umount share2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/bind/fs_bind20.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -45,4 +44,5 @@ test() EXPECT_PASS umount share1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/bind/fs_bind21.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -54,4 +53,5 @@ test() EXPECT_PASS umount dir4 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/bind/fs_bind22.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -37,4 +36,5 @@ test() EXPECT_PASS umount parent } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/bind/fs_bind23.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -37,4 +36,5 @@ test() EXPECT_PASS umount tmp2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/bind/fs_bind24.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -32,4 +31,5 @@ test() EXPECT_PASS umount dir1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/cloneNS/fs_bind_cloneNS01.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -35,4 +34,5 @@ test() EXPECT_PASS umount dir1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/cloneNS/fs_bind_cloneNS02.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -50,4 +49,5 @@ test() EXPECT_PASS umount dir1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/cloneNS/fs_bind_cloneNS03.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -24,4 +23,5 @@ test() EXPECT_PASS umount dir1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/cloneNS/fs_bind_cloneNS04.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -28,4 +27,5 @@ test() EXPECT_PASS umount dir1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/cloneNS/fs_bind_cloneNS05.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -52,4 +51,5 @@ test() EXPECT_PASS umount parent } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/cloneNS/fs_bind_cloneNS06.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -74,4 +73,5 @@ test() EXPECT_PASS umount dir1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/cloneNS/fs_bind_cloneNS07.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -52,4 +51,5 @@ test() EXPECT_PASS umount parent2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/fs_bind_lib.sh +3 -4
@@ -12,10 +12,6 @@ TST_CLEANUP="${TST_CLEANUP:-fs_bind_cleanup}" TST_TESTFUNC=fs_bind_test TST_NEEDS_CMDS="mount umount awk sed" -. tst_test.sh - -[ -z "$FS_BIND_TESTFUNC" ] && tst_brk TBROK "Please set FS_BIND_TESTFUNC before sourcing fs_bind_lib.sh" - # Test interface: # # FS_BIND_TESTFUNC is the real testfunction. Please do not use
@@ -245,3 +241,6 @@ fs_bind_test() _fs_bind_cleanup_test } + +. tst_test.sh +[ -z "$FS_BIND_TESTFUNC" ] && tst_brk TBROK "Please set FS_BIND_TESTFUNC before sourcing fs_bind_lib.sh"
testcases/kernel/fs/fs_bind/fs_bind_regression.sh +1 -1
@@ -7,7 +7,6 @@ TST_CNT=3 FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test1() {
@@ -53,4 +52,5 @@ test3() EXPECT_PASS umount dir2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/move/fs_bind_move01.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -41,4 +40,5 @@ test() EXPECT_PASS umount parent2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/move/fs_bind_move02.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -42,4 +41,5 @@ test() EXPECT_PASS umount parent2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/move/fs_bind_move03.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -44,4 +43,5 @@ test() EXPECT_PASS umount parent2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/move/fs_bind_move04.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -38,4 +37,5 @@ test() EXPECT_PASS umount parent2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/move/fs_bind_move05.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -41,4 +40,5 @@ test() EXPECT_PASS umount parent2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/move/fs_bind_move06.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -37,4 +36,5 @@ test() EXPECT_PASS umount parent2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/move/fs_bind_move07.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -38,4 +37,5 @@ test() EXPECT_PASS umount parent2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/move/fs_bind_move08.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -32,4 +31,5 @@ test() EXPECT_PASS umount parent2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/move/fs_bind_move09.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -47,4 +46,5 @@ test() EXPECT_PASS umount parent2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/move/fs_bind_move10.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -43,4 +42,5 @@ test() EXPECT_PASS umount parent2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/move/fs_bind_move11.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -44,4 +43,5 @@ test() EXPECT_PASS umount parent2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/move/fs_bind_move12.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -42,4 +41,5 @@ test() EXPECT_PASS umount parent2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/move/fs_bind_move13.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -27,4 +26,5 @@ test() EXPECT_PASS umount parent2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/move/fs_bind_move14.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -29,4 +28,5 @@ test() EXPECT_PASS umount parent2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/move/fs_bind_move15.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -29,4 +28,5 @@ test() EXPECT_PASS umount parent2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/move/fs_bind_move16.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -26,4 +25,5 @@ test() EXPECT_PASS umount parent2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/move/fs_bind_move17.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -24,4 +23,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/move/fs_bind_move18.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -44,4 +43,5 @@ test() EXPECT_PASS umount parent2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/move/fs_bind_move19.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -44,4 +43,5 @@ test() EXPECT_PASS umount parent2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/move/fs_bind_move20.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -28,4 +27,5 @@ test() EXPECT_PASS umount parent2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/move/fs_bind_move21.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -41,4 +40,5 @@ test() EXPECT_PASS umount parent2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/move/fs_bind_move22.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -34,4 +33,5 @@ test() EXPECT_PASS umount tmp2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind01.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -47,4 +46,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind02.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -47,4 +46,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind03.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -58,4 +57,5 @@ test() EXPECT_PASS umount share1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind04.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -49,4 +48,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind05.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -59,4 +58,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind06.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -49,4 +48,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind07-2.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -34,4 +33,5 @@ test() EXPECT_PASS umount share2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind07.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -59,4 +58,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind08.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -49,4 +48,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind09.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -60,4 +59,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind10.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -55,4 +54,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind11.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -65,4 +64,5 @@ test() EXPECT_PASS umount share2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind12.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -55,4 +54,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind13.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -36,4 +35,5 @@ test() EXPECT_PASS umount share2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind14.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -32,4 +31,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind15.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -42,4 +41,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind16.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -33,4 +32,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind17.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -47,4 +46,5 @@ test() EXPECT_PASS umount share1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind18.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -47,4 +46,5 @@ test() EXPECT_PASS umount share1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind19.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -50,4 +49,5 @@ test() EXPECT_PASS umount share2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind20.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -47,4 +46,5 @@ test() EXPECT_PASS umount share1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind21.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -53,4 +52,5 @@ test() EXPECT_PASS umount share1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind22.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -46,4 +45,5 @@ test() EXPECT_PASS umount parent2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind23.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -46,4 +45,5 @@ test() EXPECT_PASS umount share1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind24.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -46,4 +45,5 @@ test() EXPECT_PASS umount share1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind25.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -53,4 +52,5 @@ test() EXPECT_PASS umount share1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind26.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -48,4 +47,5 @@ test() EXPECT_PASS umount share1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind27.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -53,4 +52,5 @@ test() EXPECT_PASS umount share1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind28.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -48,4 +47,5 @@ test() EXPECT_PASS umount share1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind29.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -40,4 +39,5 @@ test() EXPECT_PASS umount parent2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind30.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -35,4 +34,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind31.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -42,4 +41,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind32.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -35,4 +34,5 @@ test() EXPECT_PASS umount parent1 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind33.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -56,4 +55,5 @@ test() EXPECT_PASS umount dir4 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind34.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -40,4 +39,5 @@ test() EXPECT_PASS umount parent } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind35.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -43,4 +42,5 @@ test() EXPECT_PASS umount parent } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind36.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -38,4 +37,5 @@ test() EXPECT_PASS umount parent } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind37.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -52,4 +51,5 @@ test() EXPECT_PASS umount parent2/child2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind38.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -51,4 +50,5 @@ test() EXPECT_PASS umount parent2/child2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/fs_bind/rbind/fs_bind_rbind39.sh +1 -1
@@ -6,7 +6,6 @@ FS_BIND_TESTFUNC=test -. fs_bind_lib.sh test() {
@@ -28,4 +27,5 @@ test() EXPECT_PASS umount parent2 } +. fs_bind_lib.sh tst_run
testcases/kernel/fs/iso9660/isofs.sh +1 -2
@@ -14,8 +14,6 @@ TST_NEEDS_TMPDIR=1 TST_SETUP=setup TST_TESTFUNC=do_test -. tst_test.sh - MAX_DEPTH=3 MAX_DIRS=4
@@ -97,4 +95,5 @@ do_test() done } +. tst_test.sh tst_run
testcases/kernel/fs/linktest/linktest.sh +1 -2
@@ -11,8 +11,6 @@ TST_OPTS="a:s:" TST_PARSE_ARGS=parse_args TST_USAGE=usage -. tst_test.sh - hard_links=1000 soft_links=1000
@@ -72,4 +70,5 @@ do_test() rm -rf hlink.$$ slink.$$ } +. tst_test.sh tst_run
testcases/kernel/fs/quota_remount/quota_remount_test01.sh +1 -2
@@ -14,8 +14,6 @@ TST_CLEANUP=do_clean TST_TESTFUNC=do_test TST_MIN_KVER="2.6.26" -. tst_test.sh - do_setup() { if [ ! -d /proc/sys/fs/quota ]; then
@@ -77,4 +75,5 @@ do_test() do_clean } +. tst_test.sh tst_run
testcases/kernel/mem/vma/vma05.sh +1 -2
@@ -23,8 +23,6 @@ TST_NEEDS_ROOT=1 TST_NEEDS_TMPDIR=1 TST_NEEDS_CMDS="gdb" -. tst_test.sh - CORE_LIMIT=$(ulimit -c) CORE_PATTERN=$(cat /proc/sys/kernel/core_pattern)
@@ -64,4 +62,5 @@ vma_report_check() fi } +. tst_test.sh tst_run
testcases/kernel/numa/numa01.sh +1 -2
@@ -22,8 +22,6 @@ TST_NEEDS_TMPDIR=1 TST_NEEDS_ROOT=1 TST_NEEDS_CMDS="awk bc numactl numastat" -. tst_test.sh - # Awk the field matching the node value for numastat # $1 - Pid number # $2 - Node number
@@ -383,4 +381,5 @@ test9() tst_res TPASS "NUMA preferred node policy verified with THP enabled" } +. tst_test.sh tst_run
testcases/kernel/security/integrity/ima/tests/evm_overlay.sh +1 -1
@@ -10,7 +10,6 @@ TST_SETUP="setup" TST_CLEANUP="cleanup" TST_NEEDS_DEVICE=1 TST_CNT=4 -. ima_setup.sh setup() {
@@ -91,4 +90,5 @@ cleanup() TST_MNT_PARAMS="$params_backup" } +. ima_setup.sh tst_run
testcases/kernel/security/integrity/ima/tests/ima_conditionals.sh +1 -2
@@ -13,8 +13,6 @@ TST_NEEDS_CMDS="cat chgrp chown id sg sudo" TST_CNT=1 TST_NEEDS_DEVICE=1 -. ima_setup.sh - verify_measurement() { local request="$1"
@@ -63,4 +61,5 @@ test1() verify_measurement fgroup } +. ima_setup.sh tst_run
testcases/kernel/security/integrity/ima/tests/ima_kexec.sh +1 -2
@@ -13,8 +13,6 @@ TST_CNT=3 TST_NEEDS_DEVICE=1 TST_SETUP="setup" -. ima_setup.sh - IMA_KEXEC_IMAGE="${IMA_KEXEC_IMAGE:-/boot/vmlinuz-$(uname -r)}" REQUIRED_POLICY='^measure.*func=KEXEC_CMDLINE'
@@ -117,4 +115,5 @@ test() esac } +. ima_setup.sh tst_run
testcases/kernel/security/integrity/ima/tests/ima_keys.sh +1 -3
@@ -12,8 +12,6 @@ TST_NEEDS_DEVICE=1 TST_SETUP=setup TST_CLEANUP=cleanup -. ima_setup.sh - FUNC_KEYCHECK='func=KEY_CHECK' REQUIRED_POLICY="^measure.*$FUNC_KEYCHECK"
@@ -28,7 +26,6 @@ cleanup() tst_is_num $KEYRING_ID && keyctl clear $KEYRING_ID } - require_valid_policy_template() { while read line; do
@@ -145,4 +142,5 @@ test2() fi } +. ima_setup.sh tst_run
testcases/kernel/security/integrity/ima/tests/ima_measurements.sh +1 -2
@@ -11,8 +11,6 @@ TST_SETUP="setup" TST_CNT=3 TST_NEEDS_DEVICE=1 -. ima_setup.sh - setup() { require_ima_policy_cmdline "tcb"
@@ -93,4 +91,5 @@ test3() EXPECT_FAIL "grep $file $ASCII_MEASUREMENTS" } +. ima_setup.sh tst_run
testcases/kernel/security/integrity/ima/tests/ima_policy.sh +1 -2
@@ -9,8 +9,6 @@ TST_SETUP="setup" TST_CNT=2 -. ima_setup.sh - setup() { require_policy_writable
@@ -75,4 +73,5 @@ test2() fi } +. ima_setup.sh tst_run
testcases/kernel/security/integrity/ima/tests/ima_selinux.sh +1 -2
@@ -14,8 +14,6 @@ TST_CNT=2 TST_NEEDS_DEVICE=1 TST_SETUP="setup" -. ima_setup.sh - FUNC_CRITICAL_DATA='func=CRITICAL_DATA' REQUIRED_POLICY="^measure.*$FUNC_CRITICAL_DATA"
@@ -168,4 +166,5 @@ test2() validate_policy_capabilities $measured_data } +. ima_setup.sh tst_run
testcases/kernel/security/integrity/ima/tests/ima_setup.sh +2 -2
@@ -14,8 +14,6 @@ TST_NEEDS_ROOT=1 # TST_NEEDS_DEVICE can be unset, therefore specify explicitly TST_NEEDS_TMPDIR=1 -. tst_test.sh - SYSFS="/sys" UMOUNT= TST_FS_TYPE="ext3"
@@ -350,6 +348,8 @@ require_evmctl() fi } +. tst_test.sh + # loop device is needed to use only for tmpfs TMPDIR="${TMPDIR:-/tmp}" if [ "$(df -T $TMPDIR | tail -1 | awk '{print $2}')" != "tmpfs" -a -n "$TST_NEEDS_DEVICE" ]; then
testcases/kernel/security/integrity/ima/tests/ima_tpm.sh +1 -2
@@ -10,8 +10,6 @@ TST_CNT=2 TST_NEEDS_CMDS="awk cut tail" TST_SETUP="setup" -. ima_setup.sh - EVMCTL_REQUIRED='1.3.1' ERRMSG_EVMCTL="=> install evmctl >= $EVMCTL_REQUIRED" ERRMSG_TPM="TPM hardware support not enabled in kernel or no TPM chip found"
@@ -296,4 +294,5 @@ test2() fi } +. ima_setup.sh tst_run
testcases/kernel/security/integrity/ima/tests/ima_violations.sh +2 -3
@@ -11,9 +11,6 @@ TST_CLEANUP="cleanup" TST_CNT=3 TST_NEEDS_DEVICE=1 -. ima_setup.sh -. daemonlib.sh - setup() { FILE="test.txt"
@@ -153,4 +150,6 @@ test3() tst_sleep 2s } +. ima_setup.sh +. daemonlib.sh tst_run
testcases/kernel/tracing/dynamic_debug/dynamic_debug01.sh +1 -4
@@ -17,9 +17,6 @@ TST_NEEDS_ROOT=1 TST_SETUP=setup TST_CLEANUP=cleanup -. tst_test.sh - - DEBUGFS_WAS_MOUNTED=0 DEBUGFS_PATH="" DEBUGFS_CONTROL=""
@@ -27,7 +24,6 @@ DYNDEBUG_STATEMENTS="./debug_statements" EMPTY_FLAG="-" NEW_INTERFACE=0 - mount_debugfs() { if grep -q debugfs /proc/mounts ; then
@@ -153,4 +149,5 @@ cleanup() fi } +. tst_test.sh tst_run
testcases/lib/tst_net.sh +2 -3
@@ -1,7 +1,7 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later # Copyright (c) 2014-2017 Oracle and/or its affiliates. All Rights Reserved. -# Copyright (c) 2016-2021 Petr Vorel <[email protected]> +# Copyright (c) 2016-2022 Petr Vorel <[email protected]> # Author: Alexey Kodanev <[email protected]> [ -n "$TST_LIB_NET_LOADED" ] && return 0
@@ -71,8 +71,6 @@ tst_net_setup() fi } -[ -n "$TST_USE_LEGACY_API" ] && . test.sh || . tst_test.sh - if [ "$TST_PARSE_ARGS_CALLER" = "$TST_PARSE_ARGS" ]; then tst_res TWARN "TST_PARSE_ARGS_CALLER same as TST_PARSE_ARGS, unset it ($TST_PARSE_ARGS)" unset TST_PARSE_ARGS_CALLER
@@ -937,6 +935,7 @@ tst_default_max_pkt() echo "$((mtu + mtu / 10))" } +[ -n "$TST_USE_LEGACY_API" ] && . test.sh || . tst_test.sh [ -n "$TST_PRINT_HELP" -o -n "$TST_NET_SKIP_VARIABLE_INIT" ] && return 0 # Management Link
testcases/lib/tst_test.sh +11 -18
@@ -1,6 +1,6 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later -# Copyright (c) Linux Test Project, 2014-2021 +# Copyright (c) Linux Test Project, 2014-2022 # Author: Cyril Hrubis <[email protected]> # # LTP test library for shell.
@@ -642,17 +642,6 @@ tst_run() done fi - OPTIND=1 - - while getopts ":hi:$TST_OPTS" _tst_name $TST_ARGS; do - case $_tst_name in - 'h') tst_usage; exit 0;; - 'i') TST_ITERATIONS=$OPTARG;; - '?') tst_usage; exit 2;; - *) $TST_PARSE_ARGS "$_tst_name" "$OPTARG";; - esac - done - if ! tst_is_int "$TST_ITERATIONS"; then tst_brk TBROK "Expected number (-i) not '$TST_ITERATIONS'" fi
@@ -818,22 +807,26 @@ if [ -z "$TST_NO_DEFAULT_RUN" ]; then TST_ARGS="$@" - while getopts ":hi:$TST_OPTS" tst_name; do - case $tst_name in - 'h') TST_PRINT_HELP=1;; - *);; + OPTIND=1 + + while getopts ":hi:$TST_OPTS" _tst_name $TST_ARGS; do + case $_tst_name in + 'h') tst_usage; exit 0;; + 'i') TST_ITERATIONS=$OPTARG;; + '?') tst_usage; exit 2;; + *) $TST_PARSE_ARGS "$_tst_name" "$OPTARG";; esac done shift $((OPTIND - 1)) if [ -n "$TST_POS_ARGS" ]; then - if [ -z "$TST_PRINT_HELP" -a $# -ne "$TST_POS_ARGS" ]; then + if [ $# -ne "$TST_POS_ARGS" ]; then tst_brk TBROK "Invalid number of positional parameters:"\ "have ($@) $#, expected ${TST_POS_ARGS}" fi else - if [ -z "$TST_PRINT_HELP" -a $# -ne 0 ]; then + if [ $# -ne 0 ]; then tst_brk TBROK "Unexpected positional arguments '$@'" fi fi
testcases/misc/lvm/cleanup_lvm.sh +1 -1
@@ -7,7 +7,6 @@ TST_TESTFUNC=cleanup_lvm TST_NEEDS_ROOT=1 TST_NEEDS_CMDS="losetup umount vgremove" -. tst_test.sh LVM_DIR="${LVM_DIR:-/tmp}" LVM_TMPDIR="$LVM_DIR/ltp/growfiles"
@@ -32,4 +31,5 @@ cleanup_lvm() tst_res TPASS "LVM configuration for LTP removed successfully." } +. tst_test.sh tst_run
testcases/misc/lvm/generate_lvm_runfile.sh +1 -1
@@ -7,7 +7,6 @@ TST_TESTFUNC=generate_runfile TST_NEEDS_ROOT=1 TST_NEEDS_CMDS="sed" -. tst_test.sh LVM_DIR="${LVM_DIR:-/tmp}" LVM_TMPDIR="$LVM_DIR/ltp/growfiles"
@@ -30,4 +29,5 @@ generate_runfile() tst_res TPASS "Runfile $OUTFILE successfully created" } +. tst_test.sh tst_run
testcases/misc/lvm/prepare_lvm.sh +1 -1
@@ -7,7 +7,6 @@ TST_TESTFUNC=prepare_lvm TST_NEEDS_ROOT=1 TST_NEEDS_CMDS="mount pvcreate vgcreate lvcreate" -. tst_test.sh LVM_DIR="${LVM_DIR:-/tmp}" LVM_TMPDIR="$LVM_DIR/ltp/growfiles"
@@ -81,4 +80,5 @@ prepare_lvm() tst_res TPASS "LVM mounts are ready" } +. tst_test.sh tst_run
testcases/network/busy_poll/busy_poll01.sh +1 -2
@@ -4,8 +4,6 @@ # # Author: Alexey Kodanev <[email protected]> -. busy_poll_lib.sh - cleanup() { [ -n "$busy_read_old" ] && \
@@ -47,4 +45,5 @@ test() tst_netload_compare $(cat res_0) $(cat res_50) 1 } +. busy_poll_lib.sh tst_run
testcases/network/busy_poll/busy_poll02.sh +1 -2
@@ -4,8 +4,6 @@ # # Author: Alexey Kodanev <[email protected]> -. busy_poll_lib.sh - cleanup() { [ -n "$busy_poll_old" ] && \
@@ -39,4 +37,5 @@ test() tst_netload_compare $(cat res_0) $(cat res_50) 1 } +. busy_poll_lib.sh tst_run
testcases/network/busy_poll/busy_poll03.sh +1 -2
@@ -6,8 +6,6 @@ TST_TEST_DATA="udp udp_lite" -. busy_poll_lib.sh - cleanup() { [ -n "$busy_poll_old" ] && \
@@ -42,4 +40,5 @@ test() tst_netload_compare $(cat res_0) $(cat res_50) 1 } +. busy_poll_lib.sh tst_run
testcases/network/busy_poll/busy_poll_lib.sh +3 -2
@@ -1,5 +1,6 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) Linux Test Project, 2016-2022 # Copyright (c) 2016-2018 Oracle and/or its affiliates. All Rights Reserved. # Copyright (c) Linux Test Project, 2016-2022
@@ -13,8 +14,6 @@ TST_NEEDS_CMDS="pkill sysctl ethtool" # for more stable results set to a single thread TST_NETLOAD_CLN_NUMBER=1 -. tst_net.sh - busy_poll_check_config() { if [ ! -f "/proc/sys/net/core/busy_read" -a \
@@ -28,3 +27,5 @@ busy_poll_check_config() tst_brk TCONF "busy poll not supported by driver" fi } + +. tst_net.sh
testcases/network/dccp/dccp01.sh +1 -1
@@ -7,7 +7,6 @@ TST_TESTFUNC="test" TST_NEEDS_TMPDIR=1 TST_NEEDS_ROOT=1 -. tst_net.sh test1() {
@@ -30,4 +29,5 @@ test3() tst_netload_compare $res0 $res1 -100 100 } +. tst_net.sh tst_run
testcases/network/dhcp/dhcp_lib.sh +3 -3
@@ -11,9 +11,6 @@ TST_NEEDS_TMPDIR=1 TST_NEEDS_ROOT=1 TST_NEEDS_CMDS="cat $dhcp_name awk ip pgrep pkill dhclient" -. tst_net.sh -. daemonlib.sh - iface0="ltp_veth0" iface1="ltp_veth1"
@@ -174,3 +171,6 @@ EOF stop_dhcp } + +. tst_net.sh +. daemonlib.sh
testcases/network/dhcp/dhcpd_tests.sh +3 -3
@@ -7,10 +7,9 @@ # Author: Manoj Iyer, [email protected] # Author: Alexey Kodanev [email protected] -dhcp_name="dhcpd" - -. dhcp_lib.sh TST_SETUP="setup_dhcp" + +dhcp_name="dhcpd" lease_dir="/var/lib/misc" lease_file="$lease_dir/dhcpd.leases_tst"
@@ -84,4 +83,5 @@ print_dhcp_version() dhcpd --version 2>&1 } +. dhcp_lib.sh tst_run
testcases/network/dhcp/dnsmasq_tests.sh +14 -14
@@ -5,20 +5,6 @@ # # Author: Alexey Kodanev [email protected] -dhcp_name="dnsmasq" - -. dhcp_lib.sh - -log="/var/log/dnsmasq.tst.log" - -lease_dir="/var/lib/misc" -tst_selinux_enforced && lease_dir="/var/lib/dnsmasq" -lease_file="$lease_dir/dnsmasq.tst.leases" - -common_opt="--no-hosts --no-resolv --dhcp-authoritative \ - --log-facility=$log --interface=$iface0 \ - --dhcp-leasefile=$lease_file --port=0 --conf-file= " - start_dhcp() { dnsmasq $common_opt \
@@ -47,4 +33,18 @@ print_dhcp_version() dnsmasq --version | head -2 } +. dhcp_lib.sh + +lease_dir="/var/lib/misc" +tst_selinux_enforced && lease_dir="/var/lib/dnsmasq" + +dhcp_name="dnsmasq" +log="/var/log/dnsmasq.tst.log" + +lease_file="$lease_dir/dnsmasq.tst.leases" + +common_opt="--no-hosts --no-resolv --dhcp-authoritative \ + --log-facility=$log --interface=$iface0 \ + --dhcp-leasefile=$lease_file --port=0 --conf-file= " + tst_run
testcases/network/iproute/ip_tests.sh +1 -1
@@ -15,7 +15,6 @@ TST_NEEDS_ROOT=1 TST_NEEDS_CMDS="cat awk diff" TST_NEEDS_DRIVERS="dummy" -. tst_net.sh rm_dummy=
@@ -251,4 +250,5 @@ test6() tst_res TPASS "'ip maddr' command successfully tested" } +. tst_net.sh tst_run
testcases/network/iptables/iptables01.sh +0 -1
@@ -5,5 +5,4 @@ use_iptables=1 . iptables_lib.sh - tst_run
testcases/network/iptables/iptables_lib.sh +3 -2
@@ -1,5 +1,6 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) Linux Test Project, 2019-2022 # Copyright (c) 2018-2019 Oracle and/or its affiliates. All Rights Reserved. # Copyright (c) International Business Machines Corp., 2001 # Copyright (c) Linux Test Project, 2019-2022
@@ -15,8 +16,6 @@ TST_SETUP="${TST_SETUP:-init}" TST_CLEANUP="${TST_CLEANUP:-cleanup}" TST_NEEDS_CMDS="grep telnet" -. tst_net.sh - NFRUN() { local rule
@@ -380,3 +379,5 @@ test6() tst_res TINFO "$toolname limited logging succsess" tst_res TPASS "$toolname can log packets with limited rate" } + +. tst_net.sh
testcases/network/iptables/nft01.sh +1 -2
@@ -9,8 +9,6 @@ use_iptables=0 cleanup_table=0 cleanup_chain=0 -. iptables_lib.sh - do_setup() { init
@@ -35,4 +33,5 @@ do_cleanup() cleanup } +. iptables_lib.sh tst_run
testcases/network/mpls/mpls01.sh +1 -1
@@ -12,7 +12,6 @@ TST_NEEDS_ROOT=1 TST_NEEDS_DRIVERS="mpls_router" TST_NEEDS_CMDS="sysctl modprobe" -. tst_net.sh cleanup() {
@@ -67,4 +66,5 @@ test3() tst_res TPASS "created and removed mpls routes" } +. tst_net.sh tst_run
testcases/network/mpls/mpls02.sh +1 -2
@@ -6,8 +6,6 @@ TST_SETUP="setup" TST_TESTFUNC="do_test" TST_CLEANUP="cleanup" -. mpls_lib.sh - cleanup() { ip route del $ip_rmt/$mask > /dev/null 2>&1
@@ -50,4 +48,5 @@ do_test() fi } +. mpls_lib.sh tst_run
testcases/network/mpls/mpls03.sh +2 -3
@@ -6,9 +6,6 @@ TST_SETUP="setup" TST_TESTFUNC="mpls_virt_test" TST_CLEANUP="mpls_virt_cleanup" -. virt_lib.sh -. mpls_lib.sh - setup() { virt_type="gre"
@@ -21,4 +18,6 @@ setup() mpls_virt_setup } +. virt_lib.sh +. mpls_lib.sh tst_run
testcases/network/mpls/mpls04.sh +2 -3
@@ -6,9 +6,6 @@ TST_SETUP="setup" TST_TESTFUNC="mpls_virt_test" TST_CLEANUP="mpls_virt_cleanup" -. virt_lib.sh -. mpls_lib.sh - setup() { virt_type="sit"
@@ -16,4 +13,6 @@ setup() mpls_virt_setup } +. virt_lib.sh +. mpls_lib.sh tst_run
testcases/network/mpls/mpls_lib.sh +3 -1
@@ -1,5 +1,6 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) Linux Test Project, 2018-2022 # Copyright (c) 2018 Oracle and/or its affiliates. All Rights Reserved. TST_MIN_KVER="4.3"
@@ -9,7 +10,6 @@ TST_NEEDS_DRIVERS="mpls_router mpls_iptunnel mpls_gso" TST_NEEDS_CMDS="sysctl modprobe" TST_TEST_DATA="icmp tcp udp" TST_NETLOAD_BINDTODEVICE= -. tst_net.sh mpls_cleanup() {
@@ -96,3 +96,5 @@ mpls_virt_test() tst_netload -S $ip6_virt_local -H $ip6_virt_remote -T $type -A $max_size fi } + +. tst_net.sh
testcases/network/multicast/mc_cmds/mc_cmds.sh +2 -4
@@ -28,9 +28,8 @@ TCID=mc_cmds TST_TOTAL=1 - +TST_CLEANUP=do_cleanup TST_USE_LEGACY_API=1 -. tst_net.sh knob="net.ipv4.icmp_echo_ignore_broadcasts" knob_changed=
@@ -92,7 +91,6 @@ do_cleanup() tst_rmdir } +. tst_net.sh setup -TST_CLEANUP=do_cleanup - do_test
testcases/network/multicast/mc_commo/mc_commo.sh +2 -3
@@ -30,9 +30,8 @@ OUTFILE=mc_commo_out TCID=mc_commo TST_TOTAL=2 - +TST_CLEANUP=do_cleanup TST_USE_LEGACY_API=1 -. tst_net.sh do_setup() {
@@ -88,8 +87,8 @@ do_cleanup() tst_rmdir } +. tst_net.sh do_setup -TST_CLEANUP=do_cleanup for i in $(seq 1 $TST_TOTAL); do do_test
testcases/network/multicast/mc_member/mc_member.sh +2 -4
@@ -32,9 +32,8 @@ ERRFILE=${ERRFILE:-errors} TCID=mc_member TST_TOTAL=1 TST_COUNT=1 - +TST_CLEANUP=do_cleanup TST_USE_LEGACY_API=1 -. tst_net.sh setup() {
@@ -133,7 +132,6 @@ do_cleanup() tst_rmdir } +. tst_net.sh setup -TST_CLEANUP=do_cleanup - do_test
testcases/network/nfs/fsx-linux/fsx.sh +1 -2
@@ -10,8 +10,6 @@ TST_TESTFUNC="do_test" -. nfs_lib.sh - do_test() { ITERATIONS=${ITERATIONS:=50000}
@@ -25,4 +23,5 @@ do_test() fi } +. nfs_lib.sh tst_run
testcases/network/nfs/nfs_stress/nfs01.sh +1 -2
@@ -10,8 +10,6 @@ TST_TESTFUNC="do_test" -. nfs_lib.sh - do_test() { tst_res TINFO "starting 'nfs01_open_files $NFILES'"
@@ -19,4 +17,5 @@ do_test() tst_res TPASS "test finished successfully" } +. nfs_lib.sh tst_run
testcases/network/nfs/nfs_stress/nfs02.sh +1 -2
@@ -12,8 +12,6 @@ TST_CNT=3 TST_TESTFUNC="do_test" LTP_DATAFILES="$LTPROOT/testcases/bin/datafiles" -. nfs_lib.sh - do_test1() { tst_res TINFO "do_test1 $TC"
@@ -48,4 +46,5 @@ do_test3() tst_res TPASS "test3 passed" } +. nfs_lib.sh tst_run
testcases/network/nfs/nfs_stress/nfs03.sh +1 -2
@@ -8,8 +8,6 @@ TST_CLEANUP="nfs03_cleanup" TST_SETUP="nfs03_setup" TST_TESTFUNC="do_test" -. nfs_lib.sh - DIR_NUM=${DIR_NUM:-"100"} FILE_NUM=${FILE_NUM:-"100"} THREAD_NUM=${THREAD_NUM:-"1"}
@@ -92,4 +90,5 @@ nfs03_cleanup() nfs_cleanup } +. nfs_lib.sh tst_run
testcases/network/nfs/nfs_stress/nfs04.sh +1 -1
@@ -12,7 +12,6 @@ # Created by: Robbie Williamson ([email protected]) TST_TESTFUNC="do_test" -. nfs_lib.sh do_test() {
@@ -21,4 +20,5 @@ do_test() tst_res TPASS "Test finished" } +. nfs_lib.sh tst_run
testcases/network/nfs/nfs_stress/nfs05.sh +1 -2
@@ -14,8 +14,6 @@ THREAD_NUM=${THREAD_NUM:-"8"} TST_NEEDS_CMDS="make gcc" TST_TESTFUNC="do_test" -. nfs_lib.sh - do_test() { tst_res TINFO "start nfs05_make_tree -d $DIR_NUM -f $FILE_NUM -t $THREAD_NUM"
@@ -24,4 +22,5 @@ do_test() tst_res TPASS "test finished" } +. nfs_lib.sh tst_run
testcases/network/nfs/nfs_stress/nfs06.sh +1 -1
@@ -10,7 +10,6 @@ TST_TESTFUNC="do_test" TST_CLEANUP="do_cleanup" -. nfs_lib.sh THREAD_NUM=${THREAD_NUM:-"2"}
@@ -42,4 +41,5 @@ do_test() tst_res TPASS "all fsstress processes completed on '$n' NFS mounts" } +. nfs_lib.sh tst_run
testcases/network/nfs/nfs_stress/nfs07.sh +3 -5
@@ -8,9 +8,10 @@ FILE_COUNT=5000 TST_OPTS="n:" -TST_PARSE_ARGS=do_parse_args +TST_PARSE_ARGS="do_parse_args" TST_TESTFUNC="do_test" TST_SETUP="do_setup" +TST_USAGE="show_usage" do_parse_args() {
@@ -19,10 +20,6 @@ do_parse_args() esac } -. nfs_lib.sh - -TST_USAGE="show_usage" - show_usage() { nfs_usage
@@ -64,4 +61,5 @@ do_test() tst_res TPASS "All files and directories were correctly listed" } +. nfs_lib.sh tst_run
testcases/network/nfs/nfs_stress/nfs_lib.sh +2 -1
@@ -40,7 +40,6 @@ TST_NEEDS_DRIVERS="nfsd" # debugging whether test failures are related to veth/netns). LTP_NFS_NETNS_USE_LO=${LTP_NFS_NETNS_USE_LO:-} -. tst_net.sh get_socket_type() {
@@ -206,3 +205,5 @@ nfs_cleanup() n=$(( n + 1 )) done } + +. tst_net.sh
testcases/network/nfs/nfslock01/nfslock01.sh +1 -2
@@ -12,8 +12,6 @@ TST_SETUP="do_setup" TST_TESTFUNC="do_test" -. nfs_lib.sh - LUSER=${LUSER:=root} do_setup()
@@ -62,4 +60,5 @@ do_test() fi } +. nfs_lib.sh tst_run
testcases/network/nfs/nfsstat01/nfsstat01.sh +1 -2
@@ -6,8 +6,6 @@ TST_TESTFUNC="do_test" TST_NEEDS_CMDS="nfsstat" -. nfs_lib.sh - get_calls() { local name=$1
@@ -93,4 +91,5 @@ do_test() fi } +. nfs_lib.sh tst_run
testcases/network/rpc/basic_tests/rpc01/rpc01.sh +1 -1
@@ -7,7 +7,6 @@ TST_TESTFUNC=do_test TST_SETUP=do_setup TST_CLEANUP=do_cleanup TST_NEEDS_CMDS="pkill rpcinfo" -. rpc_lib.sh NUMLOOPS=${NUMLOOPS:-3} DATAFILES="${DATAFILES:-file.1 file.2}"
@@ -45,4 +44,5 @@ do_test() done } +. rpc_lib.sh tst_run
testcases/network/rpc/basic_tests/rpc_lib.sh +3 -2
@@ -1,8 +1,7 @@ #!/bin/sh -# Copyright (c) 2020-2021 Petr Vorel <[email protected]> +# Copyright (c) 2020-2022 Petr Vorel <[email protected]> TST_NEEDS_CMDS="rpcinfo $TST_NEEDS_CMDS" -. tst_net.sh check_rpc() {
@@ -19,3 +18,5 @@ check_rpc() tst_res TINFO "registered RPC:" echo "$services" } + +. tst_net.sh
testcases/network/rpc/basic_tests/rpcinfo/rpcinfo01.sh +1 -1
@@ -7,7 +7,6 @@ TST_TESTFUNC=do_test TST_SETUP=do_setup TST_NEEDS_TMPDIR=1 TST_NEEDS_CMDS="rpcinfo wc" -. rpc_lib.sh do_setup() {
@@ -53,4 +52,5 @@ do_test() EXPECT_RHOST_FAIL rpcinfo -u $thost 100000 5 } +. rpc_lib.sh tst_run
testcases/network/rpc/basic_tests/rup/rup01.sh +0 -1
@@ -19,7 +19,6 @@ TCID="rup01" TST_TOTAL=7 TST_USE_LEGACY_API=1
Lines of this file are not shown. View the raw message.
testcases/network/rpc/basic_tests/rusers/rusers01.sh +0 -1
Lines of this file are not shown. View the raw message.
testcases/network/rpc/rpc-tirpc/rpc_test.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/sockets/bind_noport01.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/stress/broken_ip/broken_ip-checksum.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/stress/broken_ip/broken_ip-dstaddr.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/stress/broken_ip/broken_ip-fragment.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/stress/broken_ip/broken_ip-ihl.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/stress/broken_ip/broken_ip-nexthdr.sh +5 -5
Lines of this file are not shown. View the raw message.
testcases/network/stress/broken_ip/broken_ip-plen.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/stress/broken_ip/broken_ip-protcol.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/stress/broken_ip/broken_ip-version.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/stress/dccp/dccp_ipsec.sh +2 -2
Lines of this file are not shown. View the raw message.
testcases/network/stress/dccp/dccp_ipsec_vti.sh +2 -2
Lines of this file are not shown. View the raw message.
testcases/network/stress/dns/dns-stress.sh +1 -5
Lines of this file are not shown. View the raw message.
testcases/network/stress/ftp/ftp-download-stress.sh +1 -3
Lines of this file are not shown. View the raw message.
testcases/network/stress/ftp/ftp-upload-stress.sh +1 -3
Lines of this file are not shown. View the raw message.
testcases/network/stress/http/http-stress.sh +1 -3
Lines of this file are not shown. View the raw message.
testcases/network/stress/icmp/icmp-uni-basic.sh +2 -2
Lines of this file are not shown. View the raw message.
testcases/network/stress/icmp/icmp-uni-vti.sh +2 -2
Lines of this file are not shown. View the raw message.
testcases/network/stress/interface/if-addr-adddel.sh +2 -2
Lines of this file are not shown. View the raw message.
testcases/network/stress/interface/if-addr-addlarge.sh +2 -2
Lines of this file are not shown. View the raw message.
testcases/network/stress/interface/if-lib.sh +3 -2
Lines of this file are not shown. View the raw message.
testcases/network/stress/interface/if-mtu-change.sh +2 -2
Lines of this file are not shown. View the raw message.
testcases/network/stress/interface/if-route-adddel.sh +2 -2
Lines of this file are not shown. View the raw message.
testcases/network/stress/interface/if-route-addlarge.sh +2 -2
Lines of this file are not shown. View the raw message.
testcases/network/stress/interface/if-updown.sh +2 -2
Lines of this file are not shown. View the raw message.
testcases/network/stress/interface/if4-addr-change.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/stress/ipsec/ipsec_lib.sh +7 -6
Lines of this file are not shown. View the raw message.
testcases/network/stress/multicast/grp-operation/mcast-group-multiple-socket.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/stress/multicast/grp-operation/mcast-group-same-group.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/stress/multicast/grp-operation/mcast-group-single-socket.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/stress/multicast/grp-operation/mcast-group-source-filter.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/stress/multicast/grp-operation/mcast-lib.sh +3 -3
Lines of this file are not shown. View the raw message.
testcases/network/stress/multicast/packet-flood/mcast-pktfld01.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/stress/multicast/packet-flood/mcast-pktfld02.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/stress/multicast/query-flood/mcast-queryfld01.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/stress/multicast/query-flood/mcast-queryfld02.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/stress/multicast/query-flood/mcast-queryfld03.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/stress/multicast/query-flood/mcast-queryfld04.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/stress/multicast/query-flood/mcast-queryfld05.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/stress/multicast/query-flood/mcast-queryfld06.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/stress/ns-tools/tst_net_stress.sh +2 -2
Lines of this file are not shown. View the raw message.
testcases/network/stress/route/route-change-dst.sh +3 -3
Lines of this file are not shown. View the raw message.
testcases/network/stress/route/route-change-gw.sh +3 -3
Lines of this file are not shown. View the raw message.
testcases/network/stress/route/route-change-if.sh +3 -3
Lines of this file are not shown. View the raw message.
testcases/network/stress/route/route-change-netlink-dst.sh +2 -2
Lines of this file are not shown. View the raw message.
testcases/network/stress/route/route-change-netlink-gw.sh +2 -2
Lines of this file are not shown. View the raw message.
testcases/network/stress/route/route-change-netlink-if.sh +2 -2
Lines of this file are not shown. View the raw message.
testcases/network/stress/route/route-lib.sh +3 -2
Lines of this file are not shown. View the raw message.
testcases/network/stress/route/route-redirect.sh +2 -2
Lines of this file are not shown. View the raw message.
testcases/network/stress/sctp/sctp_ipsec.sh +2 -2
Lines of this file are not shown. View the raw message.
testcases/network/stress/sctp/sctp_ipsec_vti.sh +2 -2
Lines of this file are not shown. View the raw message.
testcases/network/stress/ssh/ssh-stress.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/stress/tcp/tcp_ipsec.sh +2 -2
Lines of this file are not shown. View the raw message.
testcases/network/stress/tcp/tcp_ipsec_vti.sh +2 -2
Lines of this file are not shown. View the raw message.
testcases/network/stress/udp/udp_ipsec.sh +2 -2
Lines of this file are not shown. View the raw message.
testcases/network/stress/udp/udp_ipsec_vti.sh +2 -2
Lines of this file are not shown. View the raw message.
testcases/network/tcp_cmds/arping/arping01.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/tcp_cmds/clockdiff/clockdiff01.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/tcp_cmds/host/host01.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/tcp_cmds/ipneigh/ipneigh01.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/tcp_cmds/netstat/netstat01.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/tcp_cmds/ping/ping01.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/tcp_cmds/ping/ping02.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/tcp_cmds/sendfile/sendfile01.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/tcp_cmds/tcpdump/tcpdump01.sh +1 -2
Lines of this file are not shown. View the raw message.
testcases/network/tcp_cmds/telnet/telnet01.sh +2 -1
Lines of this file are not shown. View the raw message.
testcases/network/tcp_cmds/tracepath/tracepath01.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/tcp_fastopen/tcp_fastopen_run.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/traceroute/traceroute01.sh +1 -1
Lines of this file are not shown. View the raw message.
testcases/network/virt/wireguard_lib.sh +2 -1
Lines of this file are not shown. View the raw message.
testcases/network/xinetd/xinetd_tests.sh +1 -1
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 5 lines
2.35.3 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Part of the diff is not shown here. View the raw message.
Re: [LTP] [PATCH v2 3/4] tst_test.sh: Cleanup getopts usage
Hi,
the patch looks mostly good except for a few issue below.
testcases/kernel/device-drivers/zram/zram01.sh do_test() · line 154
Quoted 9 lines · Petr Vorel
testcases/kernel/device-drivers/zram/zram01.sh +1
-0@@ -151,4 +151,5 @@ do_test() esac } +. zram_lib.sh
zram_lib.sh appears to be imported twice here after the setup/cleanup fixes.
testcases/network/rpc/basic_tests/rup/rup01.sh TCID="rup01" · line 22
Quoted 10 lines
testcases/kernel/device-drivers/zram/zram01.sh +0
-0tst_runtestcases/network/rpc/basic_tests/rup/rup01.sh +0
-1@@ -19,7 +19,6 @@ TCID="rup01" TST_TOTAL=7 TST_USE_LEGACY_API=1 -. tst_net.sh
The tst_net.sh import got completely dropped in this file likely because there's no call to tst_run(). Instead, the test calls do_setup(), do_test() and tst_exit() directly.
testcases/network/rpc/basic_tests/rusers/rusers01.sh TCID="rusers01" · line 22
Quoted 12 lines
testcases/network/rpc/basic_tests/rup/rup01.sh +0
-0do_setup() {testcases/network/rpc/basic_tests/rusers/rusers01.sh +0
-1@@ -19,7 +19,6 @@ TCID="rusers01" TST_TOTAL=5 TST_USE_LEGACY_API=1 -. tst_net.sh
Same here.
Quoted 3 lines
testcases/network/rpc/basic_tests/rusers/rusers01.sh +0
-0do_setup() {
Signature · 10 lines
Martin Doucha [email protected] QA Engineer for Software Maintenance SUSE LINUX, s.r.o. CORSO IIa Krizikova 148/34 186 00 Prague 8 Czech Republic -- Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH v2 3/4] tst_test.sh: Cleanup getopts usage
Hi Martin,
Quoted 2 lines
Hi,
the patch looks mostly good except for a few issue below.
Again, thanks a lot for careful review, sorry for silly mistakes. At this point I'll send v3, there are quite a lot of things to fix.
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH v2 4/4 doc: Update shell API examples
In reply to Petr Vorel---
Changes v1->v2:
* Updates related to 1st and 2nd commit.
doc/library-api-writing-guidelines.txt | 11 +++++++---- doc/shell-test-api.txt | 8 ++++++++ 2 files changed, 15 insertions(+), 4 deletions(-)
doc/library-api-writing-guidelines.txt +7 -4
@@ -67,17 +67,20 @@ Changes in the shell API should not introduce uncommon dependencies Besides shell API libraries in 'testcases/lib' it's worth to put common code for particular tests into shell library. The filename should end '_lib.sh', -they should load 'tst_test.sh' or 'tst_net.sh'. +they should load 'tst_test.sh' or 'tst_net.sh' at the end of the file. Shell libraries should have conditional expansion for 'TST_SETUP' or 'TST_CLEANUP', to avoid surprises when test specific setup/cleanup function is redefined by -shell library. +shell library. Although there is not an optimal general solution because +usually test which have specific setup/cleanup also needs to call library +setup/cleanup, but it's better not to require 'TST_SETUP' or 'TST_CLEANUP' to +be on specific place. [source,sh] ------------------------------------------------------------------------------- # ipsec_lib.sh # SPDX-License-Identifier: GPL-2.0-or-later -TST_SETUP=${TST_SETUP:-ipsec_lib_setup} -. tst_test.sh +TST_SETUP="${TST_SETUP:-ipsec_lib_setup}" ... +. tst_test.sh -------------------------------------------------------------------------------
doc/shell-test-api.txt +8 -0
@@ -40,6 +40,7 @@ do_test() fi } +. tst_test.sh tst_run -------------------------------------------------------------------------------
@@ -90,6 +91,7 @@ test2() tst_res TPASS "Test $1 passed" } +. tst_test.sh tst_run # output: # foo 1 TPASS: Test 1 passed
@@ -118,6 +120,7 @@ do_test() esac } +. tst_test.sh tst_run # output: # foo 1 TPASS: Test 1 passed
@@ -145,6 +148,7 @@ do_test() tst_res TPASS "Test $1 passed with data '$2'" } +. tst_test.sh tst_run # output: # foo 1 TPASS: Test 1 passed with data 'foo'
@@ -174,6 +178,7 @@ do_test() esac } +. tst_test.sh tst_run # output: # foo 1 TPASS: Test 1 passed with data 'foo'
@@ -278,6 +283,7 @@ do_test() ... } +. tst_test.sh tst_run -------------------------------------------------------------------------------
@@ -337,6 +343,7 @@ do_test() ... } +. tst_test.sh tst_run -------------------------------------------------------------------------------
@@ -379,6 +386,7 @@ do_test() ... } +. tst_test.sh tst_run -------------------------------------------------------------------------------
Signature · 5 lines
2.35.3 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH v2 4/4] doc: Update shell API examples
Hi,
looks good, small nit below.
Quoted 17 lines · Petr Vorel
Signed-off-by Petr Vorel <[email protected]>---
Changesv1->v2:
* Updates related to 1st and 2nd commit.doc/library-api-writing-guidelines.txt | 11 +++++++---- doc/shell-test-api.txt | 8 ++++++++ 2 files changed, 15 insertions(+), 4 deletions(-)doc/library-api-writing-guidelines.txt +0
-0@@ -67,17 +67,20 @@ Changes in the shell API should not introduce uncommon dependencies Besides shell API libraries in 'testcases/lib' it's worth to put common code for particular tests into shell library. The filename should end '_lib.sh',
doc/library-api-writing-guidelines.txt Changes in the shell API should not introduce uncommon dependencies · line 77
Quoted 10 lines
doc/library-api-writing-guidelines.txt +5
-2-they should load 'tst_test.sh' or 'tst_net.sh'. +they should load 'tst_test.sh' or 'tst_net.sh' at the end of the file. Shell libraries should have conditional expansion for 'TST_SETUP' or 'TST_CLEANUP', to avoid surprises when test specific setup/cleanup function is redefined by -shell library. +shell library. Although there is not an optimal general solution because +usually test which have specific setup/cleanup also needs to call library +setup/cleanup, but it's better not to require 'TST_SETUP' or 'TST_CLEANUP' to +be on specific place.
When you've started the sentence with "although", the "but" doesn't belong there. On the last line, "at a specific position" would be better.
Quoted 79 lines
doc/library-api-writing-guidelines.txt +2
-2[source,sh] ------------------------------------------------------------------------------- # ipsec_lib.sh # SPDX-License-Identifier: GPL-2.0-or-later -TST_SETUP=${TST_SETUP:-ipsec_lib_setup} -. tst_test.sh +TST_SETUP="${TST_SETUP:-ipsec_lib_setup}" +. tst_test.sh -------------------------------------------------------------------------------doc/shell-test-api.txt +8
-0@@ -40,6 +40,7 @@ do_test() fi } +. tst_test.sh tst_run -------------------------------------------------------------------------------@@ -90,6 +91,7 @@ test2() tst_res TPASS "Test $1 passed" } +. tst_test.sh tst_run # output: # foo 1 TPASS: Test 1 passed@@ -118,6 +120,7 @@ do_test() esac } +. tst_test.sh tst_run # output: # foo 1 TPASS: Test 1 passed@@ -145,6 +148,7 @@ do_test() tst_res TPASS "Test $1 passed with data '$2'" } +. tst_test.sh tst_run # output: # foo 1 TPASS: Test 1 passed with data 'foo'@@ -174,6 +178,7 @@ do_test() esac } +. tst_test.sh tst_run # output: # foo 1 TPASS: Test 1 passed with data 'foo'@@ -278,6 +283,7 @@ do_test() } +. tst_test.sh tst_run -------------------------------------------------------------------------------@@ -337,6 +343,7 @@ do_test() } +. tst_test.sh tst_run -------------------------------------------------------------------------------@@ -379,6 +386,7 @@ do_test() } +. tst_test.sh tst_run -------------------------------------------------------------------------------
Signature · 10 lines
Martin Doucha [email protected] QA Engineer for Software Maintenance SUSE LINUX, s.r.o. CORSO IIa Krizikova 148/34 186 00 Prague 8 Czech Republic -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Petr,
Quoted 7 lines · Petr Vorel
Petr Vorel (4):
shell: Use conditional expansion for library setup/cleanup
doc: Update library API doc
tst_test.sh: Cleanup getopts usage
doc: Update shell API examples
Basically looks good. Thanks for your update!
Signature · 2 lines
Regards, Li Wang
Signature · 2 lines
-- Mailing list info: https://lists.linux.it/listinfo/ltp